[Issue 14073] Allow token strings to use other types of brackets as delimiters

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jan 28 14:51:28 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14073

--- Comment #2 from monkeyworks12 at hotmail.com ---
(In reply to bearophile_hugs from comment #1)
> (In reply to monkeyworks12 from comment #0)
> 
> >     auto t1 = crange!q{ 'a'..'z', 'A'..'Z', '0'..'9' };
> 
> >     auto t1 = crange!q['a'..'z', 'A'..'Z', '0'..'9'];
> 
> They look about the same to me. I don't see the need for this syntax
> extension. If we want to introduce new syntax it has to introduce a bigger
> gain (like the proposed [1,2]s syntax for fixed-size arrays).

This is unrelated to my proposal, but can't you do something similar with
templates?

template sa(T, T[] array)
if (isRValue!array)
{
    enum sa = array;
}

auto staticArr = sa![1, 2];

--


More information about the Digitalmars-d-bugs mailing list