ifdef-ed
out. As of v0.88 of TnFOX, GCC v4.3 finally has some very limited support for C++0x features and thus finally we can enable support. This is done by setting the enableCPP0xFeatures
variable in config.py
to True
.Changing this is a profound setting - it enables many new coding paradigms. Almost all existing code is forward compatible, but some is not. In particular, code which uses one of the new keywords as a variable name will cease to compile and additionally some constructs will need reworking to function correctly.
However, the benefits are many and huge. TnFOX has implemented move semantics for quite a few classes where it made sense since its inception, but it has always been a nasty hack which technically broke the ISO C++ coding standards - the fact it worked at all was more luck than design though of course it was and is a very common hack. MSVC had particular support through allowing non-const constructors which had to be implemented in GCC by deconsting the copy constructor parameter (always praying that the optimiser wouldn't remove the move construst). Enabling the C++0x semantics finally fixes this, and furthermore lets the optimiser know what's going on which should help greatly - in particular, we finally have proper syntax support for move-only objects and the compiler will correctly barf if you try something stupid. The move semantics in TnFOX always operated on a pointer, so speed increases in TnFOX only code will be nil - however, all the STL containers now have move support which makes all the Qt thunk emulations considerably quicker when working with value items. You need of course to add your own rvalue copy constructors in order to avail of move semantics - the STL and Qt thunk classes will default to normal lvalue copy constructors.
As of v0.88 of TnFOX, the following C++0x features have been implemented. This list is limited by what the latest GCC has implemented:
static_assert()
function (N1720). This greatly improves error message reporting. __func__
meta-variable (N2340) in error reporting.