Title
bucketsize() const only for unordered set
Status
c++11
Section
[unord.map][unord.multimap][unord.multiset]
Submitter
Nicolai Josuttis

Created on 2010-10-09.00:00:00 last changed 162 months ago

Messages

Date: 2010-11-24.14:01:03

Proposed resolution:

The wording refers to N3126.

  1. Change 23.7.1 Class template unordered_map [unord.map]/3, as indicated:
      namespace std {
        template <class Key,
          class T,
          class Hash = hash<Key>,
          class Pred = std::equal_to<Key>,
          class Alloc = std::allocator<std::pair<const Key, T> > >
        class unordered_map
        {
        public:
          [..]
          // bucket interface
          size_type bucket_count() const;
          size_type max_bucket_count() const;
          size_type bucket_size(size_type n) const;
          [..]
    
  2. Change 23.7.2 Class template unordered_multimap [unord.multimap]/3, as indicated:
      namespace std {
        template <class Key,
          class T,
          class Hash = hash<Key>,
          class Pred = std::equal_to<Key>,
          class Alloc = std::allocator<std::pair<const Key, T> > >
        class unordered_multimap
        {
        public:
          [..]
          // bucket interface
          size_type bucket_count() const;
          size_type max_bucket_count() const;
          size_type bucket_size(size_type n) const;
          [..]
    
  3. Change 23.7.4 Class template unordered_multiset [unord.multiset]/3, as indicated:
      namespace std {
        template <class Key,
          class Hash = hash<Key>,
          class Pred = std::equal_to<Key>,
          class Alloc = std::allocator<Key> >
        class unordered_multiset
        {
        public:
          [..]
          // bucket interface
          size_type bucket_count() const;
          size_type max_bucket_count() const;
          size_type bucket_size(size_type n) const;
          [..]
    
Date: 2010-11-24.14:01:03

[ Adopted at 2010-11 Batavia ]

Date: 2010-10-21.19:47:27

[ Post-Rapperswil ]

Moved to Tentatively Ready after 5 positive votes on c++std-lib.

Date: 2010-10-09.00:00:00

While bucket_size() is const for unordered_set, for all other unordered containers it is not defined as constant member function.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-11-24 14:01:03adminsetmessages: + msg5439
2010-11-14 13:10:57adminsetstatus: voting -> wp
2010-11-08 14:14:39adminsetstatus: ready -> voting
2010-10-21 19:47:27adminsetmessages: + msg4884
2010-10-21 19:47:27adminsetmessages: + msg4883
2010-10-09 00:00:00admincreate