Title
explicit map(const Allocator&) should be constexpr
Status
new
Section
[map.overview]
Submitter
Jonathan Wakely

Created on 2025-07-10.00:00:00 last changed 1 week ago

Messages

Date: 2025-07-15.10:54:38

Proposed resolution:

This wording is relative to N5008.

  1. Modify [map.overview] as indicated:

    
    // 23.4.3.2, construct/copy/destroy
    constexpr map() : map(Compare()) { }
    constexpr explicit map(const Compare& comp, const Allocator& = Allocator());
    template<class InputIterator>
      constexpr map(InputIterator first, InputIterator last,
                    const Compare& comp = Compare(), const Allocator& = Allocator());
    template<container-compatible-range <value_type> R>
      constexpr map(from_range_t, R&& rg, const Compare& comp = Compare(),
                    const Allocator& = Allocator());
    constexpr map(const map& x);
    constexpr map(map&& x);
    constexpr explicit map(const Allocator&);
    constexpr map(const map&, const type_identity_t<Allocator>&);
    constexpr map(map&&, const type_identity_t<Allocator>&);
    constexpr map(initializer_list<value_type>, const Compare& = Compare(),
                  const Allocator& = Allocator());
    
Date: 2025-07-10.00:00:00

The intent of P3372R3 was for all container constructors to be constexpr, but during application of the paper to the working draft it was observed that one `map` constructor was missed.

History
Date User Action Args
2025-07-10 12:50:54adminsetmessages: + msg14888
2025-07-10 00:00:00admincreate