c++/3282: Problems with throw and destuctor callings

Artem Khodush artem@duma.gov.ru
Thu Jun 21 02:09:00 GMT 2001


> 
> #include <iostream.h>
> int global;
> 
> class One {
> public:
>         int num;
>         One() { num=++global; cout << "One " <<num<<endl; };
>         void Copy(One second_one) { cout << "Copy " <<num<<endl; };
>         ~One() { cout << "~One "<<num<<endl; };
> };
> 

This is not a bug. Define copy constructor for class One, like        

   One( const One& ) { num=++global; cout<<"One copy constructor"<<num<<endl; }

and see if it helps.





More information about the Gcc-bugs mailing list