www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16070] New: std.meta.{ApplyLeft,ApplyRight} fail with mixed


          Issue ID: 16070
           Summary: std.meta.{ApplyLeft,ApplyRight} fail with mixed
                    type/value arguments
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

Should work:
alias Templ(T, string name) = AliasSeq!(T, name);

alias PartialL = ApplyLeft!(Templ, int);
alias FullL = PartialL!"foo";

static assert(is(FullL[0] == int));
static assert(FullL[1] == "foo");

alias PartialR = ApplyRight!(Templ, "bar");
alias FullR = PartialR!int;

static assert(is(FullR[0] == int));
static assert(FullR[1] == "bar");

May 24 2016