Hello,
Question: is there a way to delete or remove a type trait once it has
been defined? And/or redefine it?
Consider, I've got a default type trait, something like this.
template<typename T>
struct throws_exceptions {
static const bool value = true;
};
struct my_object {
//does some work with or without exception
};
template<>
struct throws_exceptions {
static const bool value = false;
}
However, in my unit test code, I want to override the default behavior
for test purposes.
template<>
struct throws_exceptions {
static const bool value = true;
}
Or just leave the type trait out.
Actually, I'm not sure I just considered an answer to my own question.
Possibly I need to separate the traits from the underlying things
being modified, and leave it as an option whether to include the
defaults, or define user-provided traits.
Best regards,
Michael Powell