Title
std::allocator_traits<std::allocator<T>>::propagate_on_container_move_assignment
Status
c++14
Section
[default.allocator]
Submitter
Ai Azuma

Created on 2011-11-08.00:00:00 last changed 131 months ago

Messages

Date: 2012-11-03.04:16:46

Proposed resolution:

This wording is relative to the FDIS.

Change [default.allocator], the class template allocator synopsis as indicated:

namespace std {
  template <class T> class allocator;

  // specialize for void:
  template <> class allocator<void> {
  public:
    typedef void* pointer;
    typedef const void* const_pointer;
    // reference-to-void members are impossible.
    typedef void value_type;
    template <class U> struct rebind { typedef allocator<U> other; };
  };

  template <class T> class allocator {
  public:
    typedef size_t size_type;
    typedef ptrdiff_t difference_type;
    typedef T* pointer;
    typedef const T* const_pointer;
    typedef T& reference;
    typedef const T& const_reference;
    typedef T value_type;
    template <class U> struct rebind { typedef allocator<U> other; };
    typedef true_type propagate_on_container_move_assignment;

    […]
  };
}
Date: 2012-11-03.04:16:46

[ 2012, Portland: applied to WP ]

Date: 2012-02-27.16:24:02

[ 2012, Kona ]

Move to Ready.

Date: 2011-12-02.00:00:00

[ 2011-12-02: Pablo comments ]

This issue has potentially some overlap with 2108. Should the trait always_compare_equal been added, this issue's resolution should be improved based on that.

Date: 2011-11-08.00:00:00

"std::allocator_traits<std::allocator<T>>::propagate_on_container_move_assignment::value" is specified as "false", according to ([default.allocator]) and ([allocator.traits.types]). However, according to ([container.requirements.general]), this specification leads to the unneeded requirements (MoveInsertable and MoveAssignable of the value type) on the move assignment operator of containers with the default allocator.

Proposed resolution:

Either of the following two changes;

  1. adding the nested typedef like "typedef std::true_type propagate_on_container_move_assignment;" in the definition of std::allocator class template,
  2. adding the explicit partial specialization of "std::allocator_traits" class template for "std::allocator" class template, in which "propagate_on_container_move_assignment" nested typedef is specified as "std::true_type".

Pablo prefers the first resolution.

History
Date User Action Args
2014-02-20 13:20:35adminsetstatus: wp -> c++14
2012-11-03 04:16:46adminsetmessages: + msg6270
2012-10-25 12:46:45adminsetstatus: voting -> wp
2012-10-16 15:35:12adminsetstatus: ready -> voting
2012-02-27 16:24:02adminsetmessages: + msg6027
2012-02-12 18:36:43adminsetstatus: new -> ready
2011-12-04 13:05:22adminsetmessages: + msg5951
2011-11-30 22:22:52adminsetmessages: + msg5937
2011-11-08 00:00:00admincreate