Can we have this Syntactic sugar.

Nick Sabalausky a at a.a
Tue Nov 24 07:26:08 PST 2009


"Long Chang" <changedalone at gmail.com> wrote in message 
news:mailman.499.1259061212.20261.digitalmars-d at puremagic.com...
> class RegExp
> {
>    enum Option{
>        X, Y, Z
>    }
>    int options;
>    this(int options = 0){ this.options = options; }
> }
>
> void main(){
>       auto reg  = new RegExp("^A.",   .Option(  X |Y|Z ) );
>       assert( RegExp .Option.X | RegExp .Option.Y| RegExp .Option.Z   ==
> reg.options );
> }
>

That's a very good idea, I like that a lot.





More information about the Digitalmars-d mailing list