[Issue 8420] isExpression and templates should capture all template parameters when using variadic TemplateParameter

2012-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8420


Simen Kjaeraas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #2 from Simen Kjaeraas  2012-07-23 10:39:36 
PDT ---
(In reply to comment #1)

> I think, now almost of cases have been covered in 2.060head.
> What case isn't covered?

No, I think that covers it. Great work!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8420] isExpression and templates should capture all template parameters when using variadic TemplateParameter

2012-07-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8420



--- Comment #1 from Kenji Hara  2012-07-23 08:43:53 PDT ---
(In reply to comment #0)
> tl;dr: inside an IsExpression, T... should match a whole 
> TemplateParameterList,
> not just a TemplateTupleParameter.

I think, now almost of cases have been covered in 2.060head.
What case isn't covered?


template TemplateInfo( T ) {
static if ( is( T t == U!V, alias U, V... ) ) {
alias U Template;
alias V Arguments;
}
}

struct Rebindable(T) {}
struct Tuple(T...) {}
struct Map(alias X, T...) {}
struct Pack(int n, T...) {}

alias TemplateInfo!( Rebindable!int ) T;
pragma(msg, T.Template, " -> ", T.Arguments);

alias TemplateInfo!( Tuple!(int) ) U;
pragma(msg, U.Template, " -> ", U.Arguments);

alias TemplateInfo!( Tuple!(int, int) ) V;
pragma(msg, V.Template, " -> ", V.Arguments);

alias TemplateInfo!( Tuple!(int, 10) ) W;
pragma(msg, W.Template, " -> ", W.Arguments);

alias TemplateInfo!( Map!(Map, int) ) X;
pragma(msg, X.Template, " -> ", X.Arguments);

alias TemplateInfo!( Pack!(10, "str") ) Y;
pragma(msg, Y.Template, " -> ", Y.Arguments);

alias TemplateInfo!( Pack!(10, int) ) Z;
pragma(msg, Z.Template, " -> ", Z.Arguments);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---