Section: 18.104.22.168 [optional.observe] Status: C++17 Submitter: Agustín K-ballo Bergé Opened: 2016-07-02 Last modified: 2017-07-30
View all other issues in [optional.observe].
View all issues with C++17 status.
optional<T>::operator->s are constrained to be constexpr functions only when T is not a type with an overloaded unary operator&. This constrain comes from the need to use addressof (or a similar mechanism), and the inability to do so in a constant expression in C++14. Given that addressof is now constexpr, this constrain is no longer needed.
Monday: P0 - tentatively ready
This wording is relative to N4594.
Modify [optional.object.observe] as indicated:
constexpr T const* operator->() const; constexpr T* operator->();
-1- Requires: *this contains a value.-2- Returns: val. -3- Throws: Nothing. -4- Remarks:
Unless T is a user-defined type with overloaded unary operator&, these functions shall be constexpr functions.