On Jun 3, 10:18*am, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
> [...]
> I have trouble getting a reasonable layout to work
> simply because its using too much horizontal space. A baby case example is
> something like
>
> * typedef typename
> * allocator_type::template rebind< ListNode >:
ther node_allocator;
Getting rid of the redundant 'typename' and 'template' keywords would
help a lot. As I understand it a cleaner syntax and the use of
concepts would allow the expression to be inferred without these.
The other fundamental problem with C++ meta-functions is that it is
based on this cumbersome conventions:
typedef meta_function <arg1, arg2>::result r;
The ideal syntax would be:
alias r = meta_function <arg1, arg2>;
The problem is to distinguish between a meta-function reference and
the type (result) that it produces. (Aside: This is the same problem
as for regular functions; distinguishing the use of the function as a
function call that evaluates to the result and the value of the
function itself; which in C++ decays to a function pointer.)
It seems that the new C++09 alias syntax provides what's needed:
template <typename T1, typename T2>
alias meta_function = ...;
Are the full gamut of template features available for templated
aliases? Such as partial specialization etc.?
Regards,
Vidar Hasfjord