libc++: implement uses-allocator construction

Marshall Clow mclow.lists at
Tue Sep 10 08:19:46 PDT 2013

Split out from <dynarray>.
Section (at least in N3691)

Howard wrote:

> However when I just now tried to do so, I created circular header dependencies.  After investigating further, adding <new> to <__functional_base> isn't so bad.  Everything <new> includes is already included by <__functional_base>.  So <__functional_base> only swells by the immediate contents of <new> which is pretty small.
> In summary, my suggestion is:
> *  Add #include <new> to <__functional_base>
> *  Move allocator_arg_t, __uses_alloc_ctor, __user_alloc_construct to <__functional_base>.

and then:

> __user_alloc_construct and __user_alloc_construct_impl needs decoration with inline _LIBCPP_INLINE_VISIBILITY.
> Case 0 of __user_alloc_construct_impl, remove unused argument name "__a".

Did all that :-)

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uses-alloc.patch
Type: application/octet-stream
Size: 5318 bytes
Desc: not available
URL: <>

More information about the cfe-commits mailing list