Version 44 of C++

Updated 2015-02-12 06:38:37 by AMG

A programming language intended to be a successor to C. Provided access to a variety of extended programming constructs such as templates, classes, methods, etc.

The official title is ISO/IEC 14882. The latest revision is "C++ 03", aka ISO/IEC 14882:2003. It updates the original 1998 edition with some errata. The specification can be downloaded in PDF form from ISO for 352 CHF. The very same PDF document (but for the title page) can be downloaded from ANSI [L1 ] for a mere US$ 18. You can also download it for Free from Google Code: [L2 ].

[Someone want to add URLs to some useful web sites?]

DKF: Tcl is not written in C++, but rather in C. This is not about to change, as it remains relatively difficult to do extremely portable ABIs in C++ due to the exact details of how compilers convert source code into object code; the tendency with C++ is to spread implementation details across class boundaries at the ABI level, which is a bit faster but also far more entangling. As such, Tcl sticks with C (and in fact a very codified and restricted type of C at that); in engineering terms, we're very conservative.

What we would like to be able to do, but can't at the moment, is unequivocally recommend a library for people who do want to mix modern Tcl and modern C++…


"Making C++ Loadable Modules Work "

A helpful guide to problems that can arise when writing Tcl extensions in C++. Written in 1998, so its documentation on the limitations of some compilers may be out of date.


Work is under way for an update of C++, codenamed "C++ 0x" (so the ISO/IEC working group seems to have some hope of finishing within this decade). Extensions that are being considered include

  • Move semantics
  • Smart, shared pointers
  • Hash tables
  • Regular expressions

This was completed in 2011.



willdye If you're searching for references to C++, then you might want to also search for strings such as "cpp" or "cplusplus". The "++" characters are problematic in certain situations, so the name "C++" has many synonyms.


underC [L3 ] an interesting lightweight C++ interpreter. The author implies [L4 ] that it should be easy to interact with Tcl/Tk from it.

See also these projects relating to C++ and Tcl development :


  Quips and Quotes

Marco Maggi quips: C++ is "the tool of the angels: only in heaven you have infinite amount of time to devote to design analysis (and to wait for the compiler to finish)."


dkf on the chat: "C++ doesn't just provide you with enough rope to hang yourself. It also provides a do-it-yourself scaffold (with instructions translated from Klingon by Papuan tribesmen). ... Experts can do very cool stuff with C++. Utter dummies can do cool stuff with C++. But everyone else is in trouble..."


The insanity that is modern (templatized) C++: [L6 ].


AMG: Aside from interoperability with already-existing C++ packages, what compelling applications (uses) for the C++ language are there?

It seems to me that most of C++ seems to be syntax sugar for stuff already present in C, for example: const (#define, enum), iostreams (printf), templates (#define), classes (struct), exceptions (return codes, errno, longjmp), virtual functions (function pointers), weird casting (straightforward casting), bool (int), // (/*...*/), references (pointers), new/delete (malloc/free), and so on.

Any actual innovation in C++? What can be done in C++ that can't be done in C?

How about function overloading and defaulted arguments? In C, I'd just embed the argument type signature into the function name, such as is done in OpenGL.

Operator overloading? I just make functions with names describing the operation being performed, e.g. "add".

Namespaces? Prefix the function or variable name, and now no one can do "using namespace" in a header file. Or use static for file scoping.

Speaking of static, what about static local variables with non-constant initializers? C++ allows this, but it has to implement it using guard flag variables that get checked all the time. The same can be done explicitly in C, but the fact that the programmer has to put them there makes him/her aware of their existence, so they're likely to look for a more efficient approach.

Or global variables with non-constant initializers? Like the above case, now the programmer has lost control over the order of initialization. Having things be automatic is nice when it works, but controlling the order of initialization strikes me as terribly important.

And so forth... Basically, I just get less and less comfortable with C++ as time goes on, the more I find that C already had the answers in a way that's simpler and more portable.

C's incomplete types, for example, seem to be more effective at data hiding than C++'s protected and private members, which become part of the ABI despite the compiler asking you to not use them (at least, not until you do "#define private public").