views:

67

answers:

1

Is there any way to change the version in a comment block?

For e.g.

const char VER[] = "1.2.3.4";

/**
 * \version (VER)
 */

I know how to do this with preprocessing and I was wondering if there were any other way?

On a related note, how do you guys handle changing version numbers in documentation, the application, etc. without changing different version numbers all over the place? Right now I have a VER-like variable in a namespace accessible by all (essentially global without namespace pollution).

+2  A: 

Most developers use a source control tool which usually provides a mechanism for obtaining the current revision, stringizing it, and inserting into the source. Something along the lines of

const char *VER = "$Rev$";
wallyk