[libcxx] r184859 - Implement full support for non-pointer pointers in custom allocators for list.

Sebastian Redl sebastian.redl at getdesigned.at
Tue Jun 25 14:12:36 PDT 2013


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





More information about the cfe-commits mailing list