www.digitalmars.com         C & C++   DMDScript  

c++ - undefined use of struct or union (operator T *&)

struct A
{ };

struct B
{
  B()
  {
    a = new A;
  }

  operator A *&()
  {
    return a;
  }

  A *a;
};


int main()
{
  A a;
  B b;

  *b = a;
  // Error: undefined use of struct or union

  return 0;
}


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Dec 21 2002