Is it possible to mark an enum value as deprecated?
e.g.
enum MyEnum {
firstvalue = 0
secondvalue,
thirdvalue, // deprecated
fourthva
You might be able to use some macro hackery.
enum MyEnum {
firstvalue = 0
secondvalue,
real_thirdvalue, // deprecated
fourthvalue
};
template
struct real_value
{
static MyEnum value()
{
1 != 2U; // Cause a warning in for example g++. Leave a comment behind for the user to translate this warning into "thirdvalue is deprecated"
return v;
}
};
#define thirdvalue (real_value::value());
This won't work in a context when a constant is needed.