Here's my two cents:
Add a static const member variable to each class, with the desired value.
That way, each instance of the same class will always have the very same value. something like:
class MyClassA
{
static const int myVal = 1;
public:
inline myVal() const { return myVal; }
}
class MyClassB
{
static const int myVal = 2;
public:
inline myVal() const { return myVal; }
}
To avoid duplicated values you might create assign them from an enum, for instance.