On 11 July 2014 20:49, Glen Fernandes
On Fri, Jul 11, 2014 at 12:18 PM, Felipe Magno de Almeida
wrote: This looks very arbitrary to me. Is there any wording in the standard that supports that allocators have to be used only for allocation of value_type (or classes that has a value_type in it)?
My understanding is that the allocators have to be used for all dynamic allocation. If this is not explicitly worded in the standard, then it should be. Otherwise allocators simply are not as useful with any other interpretation.
I looked this up earlier, as I thought the same. 23.2.1.7 says:
"Unless otherwise specified, all containers defined in this clause
obtain memory using an allocator (see 17.6.3.5)."
Which suggests to me that all allocation is done using the allocator.
I suppose debug info could be considered something that isn't obtained
by the container, as it can be external, but I wouldn't have thought
that for things like buckets.
23.2.1.3 says:
"For the components affected by this subclause that declare an
allocator_type, objects stored in these
components shall be constructed using the
allocator_traits