opCall within with

Steve Teale steve.teale at britseyeview.com
Thu Mar 19 07:41:09 PDT 2009


Simen Kjaeraas Wrote:

> On Thu, 19 Mar 2009 10:05:59 +0100, Steve Teale <steve.teale at britseyeview.com> wrote:
> 
> > YASQ - say I have
> >
> > class Glob
> > {
> >    int a;
> >    this(int) { a = n; }
> >    int opCall(int n) { return n*a; }
> > }
> >
> > Glob g = new Glob(2);
> > with (g)
> > {
> >    // should () have any special meaning here?
> >    int n = (3);
> > }
> 
> Glob g = new Glob(2);
> with ( g ) {
>     int n = 2 * ( 3 + 4 );
> }
> 
> If this sets my n to 28, Imma be pissed.

Err, well yes,silly question, what about ((3+4))?  ;-)



More information about the Digitalmars-d mailing list