Title
P0653 + P1006 should have made the other std::to_address overload constexpr
Status
c++20
Section
[pointer.conversion]
Submitter
Billy O'Neal III

Created on 2020-01-14.00:00:00 last changed 38 months ago

Messages

Date: 2020-02-01.13:19:22

Proposed resolution:

This wording is relative to N4842.

  1. Modify [memory.syn], header <memory> synopsis, as indicated:

    […]
    // [pointer.conversion], pointer conversion
    template<class T>
      constexpr T* to_address(T* p) noexcept;
    template<class Ptr>
      constexpr auto to_address(const Ptr& p) noexcept;
    […]
    
  2. Modify [pointer.conversion] as indicated:

    template<class Ptr> constexpr auto to_address(const Ptr& p) noexcept;
    

    -3- Returns: pointer_traits<Ptr>::to_address(p) if that expression is well-formed (see [pointer.traits.optmem]), otherwise to_address(p.operator->()).

Date: 2020-02-01.00:00:00

[ 2020-02-01 Status set to Tentatively Ready after seven positive votes on the reflector. ]

Date: 2020-01-14.00:00:00

While reviewing some interactions with P0653 + P1006, Billy discovered that one of the overloads was missing the constexpr tag. This might be a typo or a missed merge interaction between P0653 (which adds to_address with the pointer overload being constexpr) and P1006 (which makes pointer_traits::pointer_to constexpr). Mail was sent the LWG reflector, and Glen Fernandes, the author of P0653, indicates that this might have been an oversight.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-14 06:37:09adminsetstatus: ready -> immediate
2020-02-01 13:19:22adminsetmessages: + msg10974
2020-02-01 13:19:22adminsetstatus: new -> ready
2020-01-18 17:49:42adminsetmessages: + msg10949
2020-01-14 00:00:00admincreate