C++ Problems

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

C++ Problems

andrea.odetti-2
Hi guys,

I'm having strange problems and I would like to have your opinion:

is there something wrong in throwing an Exception in a constructor?

I don't know why, but throwing exceptions during construction generates
some strange Access Violation error elsewhere...

thanks

andrea

----------------------------------------------------------------------------------------------------------------------------------------
La presente comunicazione è destinata esclusivamente al soggetto indicato
più sopra quale destinatario o ad eventuali altri soggetti autorizzati a
riceverla. Essa contiene informazioni strettamente confidenziali e
riservate, la cui comunicazione o diffusione a terzi è proibita, salvo che
non sia stata espressamente autorizzata.
Se avete ricevuto questa comunicazione per errore, Vi preghiamo di darne
immediata comunicazione al mittente e di cancellarne ogni evidenza dai
Vostri supporti.
----------------------------------------------------------------------------------------------------------------------------------------



Reply | Threaded
Open this post in threaded view
|

Re: C++ Problems

Luigi Ballabio-2
At 12:14 PM 4/10/03 +0200, [hidden email] wrote:
>Hi guys,
>I'm having strange problems and I would like to have your opinion:
>
>is there something wrong in throwing an Exception in a constructor?

Hmm, not that I know of. A rapid Google search brought out
http://www.gotw.ca/publications/mill13.htm
for more depth.

>I don't know why, but throwing exceptions during construction generates
>some strange Access Violation error elsewhere...

We might have had something of the sort, but curiously enough, only on one
compiler (I don't remember which one---maybe Borland) and only when the
constructors were declared inline (moving them into the .cpp solved the
thing). But I don't know whether your case is similar...

Bye,
         Luigi