
On Sat, Apr 12, 2014 at 2:14 AM, Mostafa <mostafa_working_away@yahoo.com> wrote: Thank you! Some context regarding two concerns regarding design:
IMO, "class aligned_allocator_adaptor : public Allocator" is a bad design. One, conceptually aligned_allocator_adaptor is not an "Allocator" because it overrides some of "Allocator"'s core functionality, and two, it enables the following surprising behaviour:
This design was chosen because it is the convention for allocator adaptors, introduced into the C++ standard library in C++11 with scoped_allocator_adaptor. (template <class OuterAlloc, class... InnerAllocs> class scoped_allocator_adaptor : public OuterAlloc ...)
template<class A> explicit aligned_allocator_adaptor(A&& alloc) Is this function intended to forward *any* single argument to the base class constructor? If so, then the argument name "alloc" is misleading and should be changed.
Similarly, chosen for consistency with the design established with scoped_allocator_adaptor. (template <class OuterA2> scoped_allocator_adaptor(OuterA2&& outerAlloc, const InnerAllocs&... innerAllocs) ...) Glen