Generic Printable ENUM++
By Mitch Besser, June 01, 2003
Luckily, templates are not the only tool for generating code or writing generic C++. The Boost library contains a framework of macros that help when C++ templates fall short.
class MatrixMovie
{
private:
enum {Matrix, MatrixReloaded, MatrixRevolutions} value_;
public:
// member functions and overloaded operators...
};
enum {Matrix, MatrixReloaded, MatrixRevolutions}; // duplicate
// You may use either scoped or unscoped syntax:
MatrixMovie mm=MatrixMovie::Matrix;
MatrixMovie mm=Matrix;