Let's say I have a template class defined as:
template < typename A, typename B >
class something { ... }
How can I test if types A and B are of the same type? I know this can be done at runtime with typeid, but I really need this to be a compile time test.
Also, How can I specialize the class if types A and B are equal?
In the real world, A would be an stl container of some sort, std::string for example, and B would be a char or wchar_t. Internally I already check the containers value_type (compile error if not what expected). If B is the same as the containers value_type, most of the code in the class will become redundant.