Why unordered associative containers don't use allocator_traits <T> in C ++ 0x

Why aren't C ++ 0x unordered associative containers using allocator_traits to determine the type pointers of their members and const_pointer?

For example, sequential and ordered associative containers use the following definition:

typedef typename allocator_traits<Allocator>::pointer pointer; typedef typename allocator_traits<Allocator>::const_pointer const_pointer; 

While unordered associative containers use this:

 typedef typename Allocator::pointer pointer; typedef typename Allocator::const_pointer const_pointer; 

What am I missing?

+6
source share
2 answers

I don’t think you are missing something. Here is your chance to take part in the standard process. Please send a question. Instructions on how to do this are provided here:

http://lwg.github.com/issues/lwg-active.html#submit_issue

I looked through but did not find an existing problem on this.

+3
source

This has now been fixed in the current latest draft. For example, page 788:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3376.pdf

 class unordered_set { public: // types .... .... .... typedef typename allocator_traits<Allocator>::pointer pointer; typedef typename allocator_traits<Allocator>::const_pointer const_pointer; .... .... .... } 

Interestingly, en.cppreference.com (wrong you may say) agrees: http://en.cppreference.com/w/cpp/container/unordered_map

+3
source

Source: https://habr.com/ru/post/886980/


All Articles