Just a quick note ... I've been getting asked questions about adding C++ constructors and destructors to GObject-based classes.
It can be done, e.g. by calling placement new from the GObject _init function (and calling the destructor from _dispose), but that will break in a lot of subtle (and occasionally spectacular) ways.
For similar reasons, please don't add virtual methods to such classes; they will break the struct layout and general badness will occur.
Be careful about the implications of adding members with non-trivial constructors/destructors to these classes as well.. you will need to call each members' constructors and destructors by hand.
There is deep, deep magic involved here.
Once GObject is excised from a class (and all its base classes), then things are much better, and pretty much any C++ feature goes.
-mental
participants (1)
-
MenTaLguY