On Wednesday, 17 August 2016 at 19:38:22 UTC, Engine Machine
wrote:
Well, the is does work and that probably is the best solution.
I don't mind the extra type at this point. Of course, a library
solution for this type of stuff would be nice. I'd rather not
have to even use a type but rather
On 08/17/2016 09:21 PM, Lodovico Giaretta wrote:
import std.traits: TemplateOf;
static if (__traits(isSame, TemplateOf!(x.args[2]), MySequence))
{
...
}
std.traits.TemplateOf extracts the symbol representing the
uninstantiated template.
__traits(isSame, symbol1, symbol2) evaluates at
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
On 08/17/2016 08:38 PM, Engine Machine wrote:
[...]
[...]
[...]
With MySequence being a type, you can do this:
static if (is(x.args[2] == MySequence!Args, Args ...))
{
...
}
It works! Nifty that you can do that
On Wednesday, 17 August 2016 at 19:21:57 UTC, Lodovico Giaretta
wrote:
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
[...]
import std.traits: TemplateOf;
static if (__traits(isSame, TemplateOf!(x.args[2]), MySequence))
{
...
}
std.traits.TemplateOf extracts the symbol
On Wednesday, 17 August 2016 at 18:38:48 UTC, Engine Machine
wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico Giaretta
wrote:
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe
wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length =
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
On 08/17/2016 08:38 PM, Engine Machine wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico
Giaretta wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length = Args.length;
alias args = Args;
On 08/17/2016 08:38 PM, Engine Machine wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico Giaretta wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length = Args.length;
alias args = Args;
}
alias x = MySequence!(a, b, MySequence!(c, d));
static
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico Giaretta
wrote:
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe wrote:
On Tuesday, 16 August 2016 at 19:17:27 UTC, Engine Machine
wrote:
alias x = AliasSeq!(a, b, AliasSeq!(c, d));
results in a flat sequence. I would like to be
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe wrote:
On Tuesday, 16 August 2016 at 19:17:27 UTC, Engine Machine
wrote:
alias x = AliasSeq!(a, b, AliasSeq!(c, d));
results in a flat sequence. I would like to be able to keep
them separate so I can have sub sequences.
wrap them in
On Tuesday, 16 August 2016 at 19:17:27 UTC, Engine Machine wrote:
alias x = AliasSeq!(a, b, AliasSeq!(c, d));
results in a flat sequence. I would like to be able to keep
them separate so I can have sub sequences.
wrap them in a struct.
10 matches
Mail list logo