1375. reference_type should not have been removed from the allocator requirements

Section: 20.5.3.5 [allocator.requirements] Status: Dup Submitter: INCITS Opened: 2010-08-25 Last modified: 2016-02-10

Priority: Not Prioritized

View other active issues in [allocator.requirements].

View all other issues in [allocator.requirements].

View all issues with Dup status.

Duplicate of: 1318

Discussion:

Addresses US-87

reference_type should not have been removed from the allocator requirements. Even if it is always the same as value_type&, it is an important customization point for extensions and future features.

Proposed resolution:

In [allocator.requirements] Table 42 - Allocotor Requirements, Add a row (after value_type) with columns:

Expression: X::reference_type
Return type: T&
Assertion/note...: (empty)
Default: T&

[allocator.traits]:

namespace std {
  template <class Alloc> struct allocator_traits {
    typedef Alloc allocator_type;
    
    typedef typename Alloc::value_type value_type;

    typedef see below   pointer;
    typedef see below   const_pointer;
    typedef see below   void_pointer;
    typedef see below   const_void_pointer;
    typedef value_type& reference_type;

Add reference_type to allocator_traits template, defaulted to value_type&.