This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Deque... (Re: [Patch] libstdc++/23425)
Howard Hinnant wrote:
> A very minor nit: We're passing around the allocator by value for
> the purpose of function dispatching. Can we change that to by ref?
> I'd like to get ready for stateful allocators. I believe this would
> be a fairly minor mod to _M_get_Tp_allocator() and its clients.
> Perhaps starting with:
>
> _Tp_alloc_type&
> _M_get_Tp_allocator()
> { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
>
> _Tp_alloc_type const&
> _M_get_Tp_allocator() const
> { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
... but those are *inline*! That means we can do that change also within
the present library ABI! Will prepare soon a follow-up patch for all the
containers...
Thanks,
Paolo.
P.S. Double checked that are not present in the final tree-level dumps
even at -O0.