[phobos] More tuple algorithms with std.meta

Shin Fujishiro rsinfu at gmail.com
Tue Sep 28 03:10:56 PDT 2010


"Robert Jacques" <sandford at jhu.edu> wrote:
> The meta namespace has been proposed as a possible replacement for  
> __traits, etc. i.e. meta.compiles() vs __traits(compiles, ). So a  
> different module name might be appropriate.

I'll consider.  BTW, will this really happen, or rather is it necessary?
IIRC, the proposal was against the ugly syntax.  I think all the
existing __traits except compiles could be wrapped with library
templates with syntactic sanity and added flexibility.  For example:


template getMember(alias Scope, string member)
{
    alias Identity!(__traits(getMember, Scope, member)) getMember;
}

// This overload does partial application.  Useful for staticMap etc.
template getMember(alias Scope)
{
    template getMember(string member)
    {
        alias .getMember!(Scope, member) getMember;
    }
}


Shin


More information about the phobos mailing list