Title
constexpr optional<T>::operator->
Status
c++17
Section
[optional.observe]
Submitter
Agustín K-ballo Bergé

Created on 2016-07-02.00:00:00 last changed 90 months ago

Messages

Date: 2016-08-01.18:34:48

Proposed resolution:

This wording is relative to N4594.

  1. 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&, tThese functions shall be constexpr functions.

Date: 2016-08-01.18:34:48

[ 2016-07 Chicago ]

Monday: P0 - tentatively ready

Date: 2016-07-02.00:00:00

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.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-11-14 03:59:28adminsetstatus: pending -> wp
2016-11-14 03:55:22adminsetstatus: ready -> pending
2016-08-01 18:34:48adminsetmessages: + msg8280
2016-08-01 18:34:48adminsetstatus: new -> ready
2016-07-03 18:13:32adminsetmessages: + msg8238
2016-07-02 00:00:00admincreate