Commit e7bf6d4c authored by Dominik Charousset's avatar Dominik Charousset

Fix optional<T&>::operator!

parent 229391ad
...@@ -160,8 +160,8 @@ class optional { ...@@ -160,8 +160,8 @@ class optional {
union { T m_value; }; union { T m_value; };
}; };
/// Template specialization to allow `optional` /// Template specialization to allow `optional` to hold a reference
/// to hold a reference rather than an actual value. /// rather than an actual value with minimal overhead.
template <class T> template <class T>
class optional<T&> { class optional<T&> {
public: public:
...@@ -184,7 +184,7 @@ class optional<T&> { ...@@ -184,7 +184,7 @@ class optional<T&> {
} }
bool operator!() const { bool operator!() const {
return m_value != nullptr; return ! m_value;
} }
T& operator*() { T& operator*() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment