12 Optional() noexcept : m_isSet(false) {}
13 explicit Optional(const T& value) noexcept : m_value(value), m_isSet(true) {}
15 Optional(const Optional<T>&) = default;
16 Optional<T>& operator=(const Optional<T>&) = default;
18 Optional(Optional<T>&&) = default;
19 Optional<T>& operator=(Optional<T>&&) = default;
21 Optional<T>& operator=(const T & rhs) noexcept
28 const T & const_data() const noexcept { return m_value; }
29 T & data() noexcept { return m_value; }
30 const T & data() const noexcept { return m_value; }
31 bool empty() const noexcept { return !m_isSet; }
32 void reset() noexcept { m_isSet = false; }
33 void splice(const Optional<T>& rhs) noexcept
37 m_value = rhs.m_value;
41 const T& get(const T& defaultValue) const noexcept