not_null and maybe_null_* should have explicit conversion operators.

Implicit conversion operators are bad and are also against the
guidelines.
This commit is contained in:
Kern Handa 2015-09-28 10:03:25 -07:00
parent 3571792058
commit 18c5255609

View File

@ -142,7 +142,7 @@ public:
return ptr_; return ptr_;
} // the assume() should help the optimizer } // the assume() should help the optimizer
operator T() const { return get(); } explicit operator T() const { return get(); }
T operator->() const { return get(); } T operator->() const { return get(); }
bool operator==(const T& rhs) const { return ptr_ == rhs; } bool operator==(const T& rhs) const { return ptr_ == rhs; }
@ -258,7 +258,7 @@ public:
return ptr_; return ptr_;
} }
operator T() const { return get(); } explicit operator T() const { return get(); }
T operator->() const { return get(); } T operator->() const { return get(); }
private: private:
@ -328,7 +328,7 @@ public:
T get() const { return ptr_; } T get() const { return ptr_; }
operator T() const { return get(); } explicit operator T() const { return get(); }
T operator->() const { return get(); } T operator->() const { return get(); }
private: private: