www.digitalmars.com         C & C++   DMDScript  

D - RIAA and constructors

reply Christof Meerwald <cmeerw web.de> writes:
Is it a bug or does it work as designed?

auto class A
{
  this()
  // functions cannot return auto A
  {
    printf("A.this()\n");
  }

  ~this()
  {
    printf("A.~this()\n");
  }
};


int main(char[][] argv)
{
  auto A a = new A();

  printf("Hello world.\n");

  return 0;
}


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de
Oct 09 2002
parent "Walter" <walter digitalmars.com> writes:
It's a bug. -Walter

"Christof Meerwald" <cmeerw web.de> wrote in message
news:ao16gh$1hei$2 digitaldaemon.com...
 Is it a bug or does it work as designed?

 auto class A
 {
   this()
   // functions cannot return auto A
   {
     printf("A.this()\n");
   }

   ~this()
   {
     printf("A.~this()\n");
   }
 };


 int main(char[][] argv)
 {
   auto A a = new A();

   printf("Hello world.\n");

   return 0;
 }


 bye, Christof

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