Add Variant debug.

GitOrigin-RevId: 49cd9c29f8d2b9db908f0f13c0ba149598008c2e
This commit is contained in:
levlam 2018-10-26 17:27:37 +03:00
parent 28bfa4c4a6
commit 082a132edc
2 changed files with 11 additions and 1 deletions

View File

@ -24,6 +24,16 @@ class HttpUrl {
string query_; string query_;
string get_url() const; string get_url() const;
HttpUrl(Protocol protocol, string userinfo, string host, bool is_ipv6, int specified_port, int port, string query)
: protocol_(protocol)
, userinfo_(std::move(userinfo))
, host_(std::move(host))
, is_ipv6_(is_ipv6)
, specified_port_(specified_port)
, port_(port)
, query_(std::move(query)) {
}
}; };
// TODO Slice instead of MutableSlice // TODO Slice instead of MutableSlice

View File

@ -170,7 +170,7 @@ class Variant {
template <class T> template <class T>
void init_empty(T &&t) { void init_empty(T &&t) {
CHECK(offset_ == npos); CHECK(offset_ == npos) << offset_ << ' ' << typeid(T).name() << ' ' << typeid(*this).name();
offset_ = offset<T>(); offset_ = offset<T>();
new (&get<T>()) std::decay_t<T>(std::forward<T>(t)); new (&get<T>()) std::decay_t<T>(std::forward<T>(t));
} }