Versioned C++

I couldn’t agree more with Kevin’s latest article, which tackles the issue of versioned C++.

I’ve been envious of Perl’s require functionality for years. If you don’t already know, Perl programmers use statements like require 5.6.1; to indicate a version dependency.

Maybe we can get this with a #pragma in C++?

I’d like to point out that there is already some precedent for things like this in the C/C++ world:

  • A .cpp or .cc file extension really indicates that we want the “C++ version of the C language”
  • Many compilers are implementing the latest C99 changes under a -c99 command line switch
  • C++ namespaces have been used (abused?) for this purpose before (c.f. the MSVC stdext namespace)

I think what I’m really trying to do here is whine. The Perl language folks get to change their minds whenever they want. If you don’t like it, you can continue using the old version — nobody is stopping you. Meanwhile, we in the C++ world are unable even to introduce a new reserved word, for fear of breaking existing source.

Update:
I just discovered that the ISO IEC JTC1/SC22/WG21 working group (better known as the C++ Standards Committee) has some papers on this subject:

Advertisements

1 Response to “Versioned C++”



  1. 1 mark++ » Blog Archive » More Musings on Versioned C++ Trackback on June 17, 2006 at 1:53 pm
Comments are currently closed.




%d bloggers like this: