Title
Bad "constexpr" marker for destroy/destroy_n
Status
c++20
Section
[memory.syn]
Submitter
Jens Maurer

Created on 2019-10-10.00:00:00 last changed 38 months ago

Messages

Date: 2019-11-04.13:23:43

Proposed resolution:

This wording is relative to N4830.

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

    namespace std {
      […]
      
      // [specialized.destroy], destroy
      template<class T>
        constexpr void destroy_at(T* location);
      template<class ForwardIterator>
        constexpr void destroy(ForwardIterator first, ForwardIterator last);
      template<class ExecutionPolicy, class ForwardIterator>
        constexpr void destroy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
                               ForwardIterator first, ForwardIterator last);
      template<class ForwardIterator, class Size>
        constexpr ForwardIterator destroy_n(ForwardIterator first, Size n);
      template<class ExecutionPolicy, class ForwardIterator, class Size>
        constexpr ForwardIterator destroy_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
                                            ForwardIterator first, Size n);  
      […]
    }
    
Date: 2019-11-04.13:23:43

[ 2019-11 Marked as 'Ready' during Monday issue prioritization in Belfast ]

Date: 2019-10-12.15:50:12

This issue was submitted as editorial issue cplusplus/draft#3181 but is considered non-editorial.

P0784R7, approved in Cologne, added "constexpr" markers to the overloads of destroy and destroy_n taking an ExecutionPolicy parameter. This seems to be in error; parallel algorithms should not be marked "constexpr". (None of the parallel algorithms in <algorithm> is marked "constexpr".)

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: voting -> wp
2020-01-17 04:54:50adminsetstatus: ready -> voting
2019-11-04 13:23:43adminsetmessages: + msg10723
2019-11-04 13:23:43adminsetstatus: new -> ready
2019-10-12 12:01:39adminsetmessages: + msg10699
2019-10-10 00:00:00admincreate