anonymus struct or class instances as arguments

Karen Lanrap karen at digitaldaemon.com
Thu Dec 7 20:42:12 PST 2006


Leopold Walkling wrote:


> Also there isn't a way to create a struct, only by giving its
> values.

I use it along this lines:
> struct A {
>     int i;
      static A opCall(int p)
      {
          A retval;
          retval.i = p;
          return retval;
      }
> }

> void funk(A);
> 
> int main() {
       funk= A(9);
>      return 0;
> }



More information about the Digitalmars-d mailing list