[libcxx] r184859 - Implement full support for non-pointer pointers in custom allocators for list.
Howard Hinnant
hhinnant at apple.com
Tue Jun 25 14:29:37 PDT 2013
On Jun 25, 2013, at 5:12 PM, Sebastian Redl <sebastian.redl at getdesigned.at> wrote:
>
> On 25.06.2013, at 18:08, Howard Hinnant wrote:
>
>> Author: hhinnant
>> Date: Tue Jun 25 11:08:47 2013
>> New Revision: 184859
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=184859&view=rev
>> Log:
>> Implement full support for non-pointer pointers in custom allocators for list.
>>
>> + typedef typename pointer_traits<_VoidPtr>::template
>> +#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
>> + rebind<__list_node_base> __base_pointer;
>> +#else
>> + rebind<__list_node_base>::other __base_pointer;
>> +#endif
>
> I think you have about a million of these. Wouldn't it be worth it to write
>
> #ifdef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
> # define _LIBCPP_OTHER ::other
> #else
> # define _LIBCPP_OTHER
> #endif
>
> and then do
>
> typedef typename pointer_traits<_VoidPtr>::template rebind<__list_node_base>_LIBCPP_OTHER __base_pointer;
>
> ?
>
> Sebastian
>
<shrug> It is a stylistic choice. I tend to dislike dressing things up in macros too much. I find that I constantly have to go look up the definition of the preprocess to figure out what's going on. However this one I could live with. But it is on the bottom of my priority list... Today's job, probably won't finish it today, is to get custom pointers working for <vector>.
Howard
More information about the cfe-commits
mailing list