Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different .stringof format for CT Sequences depending on content #19608

Open
dlangBugzillaToGithub opened this issue Aug 12, 2019 · 0 comments
Open

Comments

@dlangBugzillaToGithub
Copy link

Simen Kjaeraas reported this on 2019-08-12T12:29:27Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=20125

Description

import std.meta;
static assert(AliasSeq!().stringof                 == "()");
static assert(AliasSeq!(1).stringof                == "tuple(1)");
static assert(AliasSeq!(1,2).stringof              == "tuple(1, 2)");
static assert(AliasSeq!(int).stringof              == "(int)");
static assert(AliasSeq!(int, int).stringof         == "(int, int)");
static assert(AliasSeq!(int, 2).stringof           == "tuple((int), 2)");
static assert(AliasSeq!(int, 2, int, int).stringof == "tuple((int), 2, (int), (int))");

As we can see above, CT sequences containing at least one value has a "tuple" prefix, while others don't. Not only that, but mixed sequences wrap every type in (brackets).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant