Commit c5d5a108 authored by Matthias Vallentin's avatar Matthias Vallentin

Provide operator-> for optional<T>.

This addition of operator-> makes the interface more compliant to the C++14
standard.
parent 5b998320
...@@ -141,6 +141,22 @@ class optional { ...@@ -141,6 +141,22 @@ class optional {
return m_value; return m_value;
} }
/**
* @brief Returns the value.
*/
inline const T* operator->() const {
CPPA_REQUIRE(valid());
return &m_value;
}
/**
* @brief Returns the value.
*/
inline T* operator->() {
CPPA_REQUIRE(valid());
return &m_value;
}
/** /**
* @brief Returns the value. * @brief Returns the value.
*/ */
......
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