Re: [gtkmm] Glib::Module API issues



>I suppose we should throw an exception, but constructors can't do that (I
>think) so we could add an operator=() instead. That would be like using a

at least with gcc 2.95 and 3, constructors can throw exceptions, no problem.

of course, many C++ pundits believe that its exactly this design issue
that leads one to conclude that you should always use a 2-stage
construction process: call the constructor (never fails, does nothing
that could fail), then call an "init" function, which might throw an
exception.

myself, i just throw exceptions from the constructor, in particular a
specific exception called failed_constructor.

--p



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]