enum string

Namespace rswhite4 at googlemail.com
Tue Aug 7 11:29:00 PDT 2012


On Tuesday, 7 August 2012 at 17:14:03 UTC, Dmitry Olshansky wrote:
> On 07-Aug-12 21:05, Namespace wrote:
>> [code]
>> import std.regex;
>>
>> enum Token : string {
>>     Blank = r"\s+"
>> }
>>
>> void main() {
>>     const string text = "Foo Bar";
>>
>>     // text.split(regex(Token.Blank)); // don't work
>>
>>     const string blank = Token.Blank;
>>     text.split(regex(blank)); // work
>> }
>> [/code]
>>
>> Can me somebody explain that? o.O
>
> isSomeString!T regression? See enum & std.traits topic in d.D.
> Seems like it will work again in 2.061...

-.-



More information about the Digitalmars-d-learn mailing list