Title
"see below" for initializer-list constructors of unordered containers
Status
c++17
Section
[unord]
Submitter
Jonathan Wakely

Created on 2013-01-06.00:00:00 last changed 89 months ago

Messages

Date: 2014-05-23.20:46:53

Proposed resolution:

This wording is relative to N3936.

  1. Edit [unord.map.overview], class template unordered_map synopsis, as follows:

    […]
    unordered_map(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    […]
    
  2. Edit [unord.map.cnstr] as follows:

    template <class InputIterator>
    unordered_map(InputIterator f, InputIterator l,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    unordered_map(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    

    -3- Effects: Constructs an empty unordered_map using the specified hash function, key equality function, and allocator, and using at least n buckets. If n is not provided, the number of buckets is implementation-defined. Then inserts elements from the range [f, l) for the first form, or from the range [il.begin(), il.end()) for the second form. max_load_factor() returns 1.0.

  3. Edit [unord.multimap.overview], class template unordered_multimap synopsis, as follows:

    […]
    unordered_multimap(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    […]
    
  4. Edit [unord.multimap.cnstr] as follows:

    template <class InputIterator>
    unordered_multimap(InputIterator f, InputIterator l,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    unordered_multimap(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    

    -3- Effects: Constructs an empty unordered_multimap using the specified hash function, key equality function, and allocator, and using at least n buckets. If n is not provided, the number of buckets is implementation-defined. Then inserts elements from the range [f, l) for the first form, or from the range [il.begin(), il.end()) for the second form. max_load_factor() returns 1.0.

  5. Edit [unord.set.overview], class template unordered_set synopsis, as follows:

    […]
    unordered_set(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    […]
    
  6. Edit [unord.set.cnstr] as follows:

    template <class InputIterator>
    unordered_set(InputIterator f, InputIterator l,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    unordered_set(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    

    -3- Effects: Constructs an empty unordered_set using the specified hash function, key equality function, and allocator, and using at least n buckets. If n is not provided, the number of buckets is implementation-defined. Then inserts elements from the range [f, l) for the first form, or from the range [il.begin(), il.end()) for the second form. max_load_factor() returns 1.0.

  7. Edit [unord.multiset.overview], class template unordered_multiset synopsis, as follows:

    […]
    unordered_multiset(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    […]
    
  8. Edit [unord.multiset.cnstr] as follows:

    template <class InputIterator>
    unordered_multiset(InputIterator f, InputIterator l,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    unordered_multiset(initializer_list<value_type> il,
      size_type n = see below,
      const hasher& hf = hasher(),
      const key_equal& eql = key_equal(),
      const allocator_type& a = allocator_type());
    

    -3- Effects: Constructs an empty unordered_multiset using the specified hash function, key equality function, and allocator, and using at least n buckets. If n is not provided, the number of buckets is implementation-defined. Then inserts elements from the range [f, l) for the first form, or from the range [il.begin(), il.end()) for the second form. max_load_factor() returns 1.0.

Date: 2014-05-23.00:00:00

[ 2014-05-23 Library reflector vote ]

The issue has been identified as Tentatively Ready based on five votes in favour.

Date: 2014-05-20.00:00:00

[ 2014-05-20 STL and Jonathan communicate ]

STL: With 2322 resolved, is there anything left for this issue to fix?

Jonathan: The synopsis still says "see below" and it's not immediately clear that "see below" means "see the definition of a different constructor, which defines the behaviour of this one due to a table defined much earlier".

Date: 2014-03-27.00:00:00

[ 2014-03-27 Jonathan improves proposed wording ]

Date: 2014-02-20.00:00:00

[ 2014-02-20 Re-open Deferred issues as Priority 4 ]

Date: 2014-01-12.11:18:37

[ 2013-09 Chicago ]

STL: ordered are also missing declarations, but issue is forthcoming

Walter: how does adding a signature address issue? — nevermind

Jayson: in his wording, isn't he just dropping the size_type?

Walter: partial fix is to introduce the name

Stefanus: explanation of requiring name because of n buckets

STL: solution for his issue satisfies both ordered and unordered and is simplier than provided wording

STL: patches general table instead

STL: proposes adding extra rows instead of extra declarations

Stefanus: clarify n in the synopsis

Walter: general rule, name is optional in declaration

Stefanus: how to proceed

Walter: significant overlap with forthcoming issue, suggestion to defer

Date: 2013-01-06.00:00:00

The unordered_map class definition in [unord.map.overview] declares an initializer-list constructor that says "see below":

unordered_map(initializer_list<value_type>,
    size_type = see below,
    const hasher& hf = hasher(),
    const key_equal& eql = key_equal(),
    const allocator_type& a = allocator_type());

But that constructor isn't defined below. The same problem exists for the other unordered associative containers.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2014-11-08 19:44:42adminsetstatus: voting -> wp
2014-11-04 10:26:50adminsetstatus: ready -> voting
2014-05-23 20:46:53adminsetmessages: + msg6976
2014-05-23 20:46:53adminsetstatus: open -> ready
2014-05-20 18:31:28adminsetmessages: + msg6962
2014-03-27 19:25:44adminsetmessages: + msg6925
2014-02-20 14:24:46adminsetmessages: + msg6884
2014-02-20 14:24:46adminsetstatus: deferred -> open
2014-01-12 11:18:37adminsetmessages: + msg6765
2014-01-12 11:18:37adminsetstatus: new -> deferred
2013-01-11 20:44:43adminsetmessages: + msg6311
2013-01-06 00:00:00admincreate