50 Optional () noexcept : valid (
false) {}
51 explicit Optional (
const T& v) noexcept : _value (v), valid (
true) {}
52 Optional (T&& v) noexcept : _value (std::move (v)), valid (
true) {}
58 _value = std::move (other._value);
62 explicit operator bool ()
const noexcept
64 setValidationChecked ();
68 const T& operator* ()
const noexcept
74 const T* operator-> ()
const noexcept
80 T& operator* ()
noexcept
86 T* operator-> ()
noexcept
98 const T& value ()
const noexcept
104 void swap (T& other)
noexcept
107 auto tmp = std::move (other);
108 other = std::move (_value);
109 _value = std::move (tmp);
117 mutable bool validationChecked {
false};
120 void setValidationChecked ()
const
123 validationChecked =
true;
126 void checkValid ()
const
129 assert (validationChecked);