|
Re: A Brief Look at C++0x
|
Posted: Jan 4, 2006 1:49 AM
|
|
Original text ========================== no properties. For example, GUI libraries have 100s of widgets, yet we still have to write getFoo(), setFoo(), isFoo() etc. By using properties, code would be greatly simplified, and there would be no run-time overhead since properties is about syntactic sugar ==========================
Sorry, but I must demur.
There is a perfectly effective, 100% speed-efficient, and, syntax aside, adequate mechanism of implementing properties in C++, as described in Chapter 35 of (my book) Imperfect C++. (To tame the syntax, it uses macros, which is a bit of a shame, but other than that it is without substantive flaw. It also facilitates the user having an overhead of one byte (+packing) per class, irrespective of the number of properties.)
The latest release of the recls library incorporates properties into the recls/C++ and recls/STL mappings. (Downloadable from http://recls.org/)
I'm currently working on a substantial library, called XMLSTL, which is a library that wraps (currently) MSXML and Xerces DOM, with SAX and other XML libs to come. It unifies syntax between the underlying libraries, has minimal coupling, and uses my C++ Properties technique. I am hoping to get an alpha out for the people who've expressed interest thus far (and anyone else) to play with this month. (Perhaps lacking in humility / realism, I see no reason at this stage that this won't be an adequate answer to the call for submissions on XML presented in http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1810.html, and will be working towards that this year.)
On a broader point, I don't see what all the fuss is about. Apart from auto, which will be a huge boon, there's precious little lacking in current C++ for anyone willing to apply a little imagination. Sorry if that's a too-last-century opinion. :-)
Cheers
Matthew
|
|