mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
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:
parent
3571792058
commit
18c5255609
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user