Re: check instance of nested variadic template

2016-11-05 Thread Gianni Pisetta via Digitalmars-d-learn
When i have time i will test it with ldc and see if the result is the same, then it will probably be a front-end bug and i will report it as an issue.

Re: check instance of nested variadic template

2016-11-05 Thread Gianni Pisetta via Digitalmars-d-learn
On Friday, 4 November 2016 at 17:37:10 UTC, Basile B. wrote: Hello, I'm not sure that's exactly what you want but check this: template A(As...) { template B(Bs...) { } } alias BI = A!(1,2).B!(3,4,5); import std.traits; template NestedTemplateArgsOf(alias

check instance of nested variadic template

2016-11-04 Thread Gianni Pisetta via Digitalmars-d-learn
Hi all, I am having issues finding a solution for this, i want to check if an alias is an istance of a variadic template nested in another variadic template. Here is an example: template A(As...) { template B(Bs...) { } } alias BI = A!(1,2).B!(3,4,5); Now i want to test if BI is an

Re: test if the alias of a template is a literal

2016-10-28 Thread Gianni Pisetta via Digitalmars-d-learn
On Friday, 28 October 2016 at 03:33:33 UTC, Basile B. wrote: Hello, I think the correct isStringLiteral would be: import std.meta; template isStringLiteral(alias V) { enum isCompileTime = is(typeof((){enum a = V;})); enum isString = is(typeof(V) == string); enum isStringLiteral

Re: test if the alias of a template is a literal

2016-10-27 Thread Gianni Pisetta via Digitalmars-d-learn
On Thursday, 27 October 2016 at 14:34:38 UTC, TheFlyingFiddle wrote: On Thursday, 27 October 2016 at 14:04:23 UTC, Gianni Pisetta wrote: Hi all, but at the moment isStringLiteral will return true even with variables of type string. So i searched for a metod to check if an alias is a literal

test if the alias of a template is a literal

2016-10-27 Thread Gianni Pisetta via Digitalmars-d-learn
Hi all, I have an AliasSeq composed of literal strings, variables and delegates. I want to build a template Optimize that will return an AliasSeq that have all adjacent literals concatenated into one. So i writed something like this: template isStringLiteral(alias V) { enum bool