Commit a6c9e6f0 authored by Dominik Charousset's avatar Dominik Charousset

added optional<void> specialization

parent cf96f365
......@@ -239,6 +239,27 @@ class optional<T&> {
};
template<>
class optional<void> {
optional() : m_valid(true) { }
optional(const none_t&) : m_valid(false) { }
inline bool valid() const { return m_valid; }
inline bool empty() const { return !m_valid; }
inline explicit operator bool() const { return valid(); }
inline bool operator!() const { return empty(); }
private:
bool m_valid;
};
/** @relates option */
template<typename T>
struct is_optional { static constexpr bool value = false; };
......
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