Title
polymorphic_allocator::destroy is extraneous
Status
c++23
Section
[mem.poly.allocator.class]
Submitter
Casey Carter

Created on 2017-11-15.00:00:00 last changed 13 months ago

Messages

Date: 2020-11-09.21:40:50

Proposed resolution:

Wording relative to N4861.

  1. Strike the declaration of destroy from the synopsis of class polymorphic_allocator in [mem.poly.allocator.class]:

    template <class T1, class T2, class U, class V>
      void construct(pair<T1,T2>* p, pair<U, V>&& pr);
    
    template <class T>
      void destroy(T* p);
    
    polymorphic_allocator select_on_container_copy_construction() const;
    
  2. Adjust the specification of delete_object in [mem.poly.allocator.mem]:

    template <class T>
      void delete_object(T* p);
    

    -13- Effects: Equivalent to:

      allocator_traits<polymorphic_allocator>::destroy(*this, p);
      deallocate_object(p);
    
  3. Strike the specification of destroy in [mem.poly.allocator.mem]:

    […]
    template <class T>
      void destroy(T* p);
    

    -17- Effects: As if by p->~T().

    […]
  4. Add a new subclause to Annex D:

    D.?? Deprecated polymorphic_allocator member function

    -1- The following member is declared in addition to those members specified in [mem.poly.allocator.mem]:

    
    namespace std::pmr {
      template<class Tp = byte>
      class polymorphic_allocator {
      public:
        template <class T>
          void destroy(T* p);
      };
    }
    
    
    template <class T>
      void destroy(T* p);
    

    -1- Effects: As if by p->~T().

Date: 2020-11-09.00:00:00

[ 2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready → WP. ]

Date: 2020-10-15.00:00:00

[ 2020-10-11; Reflector poll ]

Moved to Tentatively Ready after seven votes in favour.

Date: 2020-10-15.00:00:00

[ 2020-10-05; Jonathan provides new wording ]

Previous resolution [SUPERSEDED]:

Wording relative to N4700.

  1. Strike the declaration of destroy from the synopsis of class polymorphic_allocator in [mem.poly.allocator.class]:

    template <class T1, class T2, class U, class V>
      void construct(pair<T1,T2>* p, pair<U, V>&& pr);
    
    template <class T>
      void destroy(T* p);
    
    polymorphic_allocator select_on_container_copy_construction() const;
    
  2. Strike the specification of destroy in [mem.poly.allocator.mem]:

    […]
    template <class T>
      void destroy(T* p);
    

    14 Effects: As if by p->~T().

    […]
Date: 2019-02-21.17:23:36

[ 2019-02; Kona Wednesday night issue processing ]

Status to Open; revisit once P0339 lands. Poll taken was 5-3-2 in favor of removal.

Date: 2017-11-29.03:09:11

[ 28-Nov-2017 Mailing list discussion - set priority to P3 ]

PJ says that Dinkumware is shipping an implementation of polymorphic_allocator with destroy, so removing it would be a breaking change for him.

Date: 2017-11-15.00:00:00

polymorphic_allocator's member function destroy is exactly equivalent to the default implementation of destroy in allocator_traits ([allocator.traits.members] para 6). It should be struck from polymorphic_allocator as it provides no value.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2020-11-09 21:40:50adminsetmessages: + msg11554
2020-11-09 21:40:50adminsetstatus: ready -> wp
2020-10-11 11:26:29adminsetmessages: + msg11513
2020-10-11 11:26:29adminsetstatus: open -> ready
2020-10-05 11:47:33adminsetmessages: + msg11509
2019-02-21 17:23:36adminsetmessages: + msg10315
2019-02-21 17:23:36adminsetstatus: new -> open
2017-11-29 03:09:11adminsetmessages: + msg9572
2017-11-15 17:30:33adminsetmessages: + msg9559
2017-11-15 00:00:00admincreate