Implicit initialization is EXCELLENT

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Thu Jul 7 09:12:06 CEST 2011


Ian Kelly wrote:
> On Wed, Jul 6, 2011 at 12:49 AM, Ulrich Eckhardt
> <ulrich.eckhardt at dominolaser.com> wrote:
>> Mel wrote:
>>> In wx, many of the window classes have Create methods, for filling in
>>> various attributes in "two-step construction". [...]
>>
>> Just guessing, is it legacy, C-with-classes code rather than C++ code
>> perhaps? Haven't looked at wx for a while. Such code typically lacks
>> understanding of exceptions, which are the only way to signal failure
>> from e.g. constructors.
> 
> No, wx is C++ through and through.

No namespaces. No templates but macros. No exceptions. No C++.

Sorry, I beg to differ. BTW, they say themselves that they tolerate but not 
use exceptions, so they actually need two-stage construction if construction 
can fail, and for exactly the guessed legacy reasons.


> http://wiki.wxpython.org/TwoStageCreation

A C++ object is not a window, it is rather a proxy for managing the window. 
As such, it can be attached or detached from the underlying window, just 
like a std::fstream, so in this light it makes sense actually. Thanks for 
the link!

Uli


-- 
Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list