Classes in D and C++

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Mar 5 07:01:15 PST 2007


"Andy Little" <andy at servocomm.freeserve.co.uk> wrote in message 
news:esgps5$2116$1 at digitalmars.com...
> Aha. If I chnge struct to class I am getting something close to what I 
> want:
> import std.stdio;
> class X{
>
>      static X opCall( double n )
>      {
>         X xx;

^^^ Don't forget to 'new' the instance of X here!

>         xx.x = n;
>         return xx;
>      }
>
> private:
>   double x;
> }

>
>
> 





More information about the Digitalmars-d mailing list