Consider this code:
typedef int type1;
typedef int type2;
template <typename>
struct some_trait;
template <>
struct some_trait<type1>
{
static const int something=1;
};
template <>
struct some_trait<type2>
{
static const int something=2;
};
It fails because what the compiler sees is two specializations of some_trait<int>
.
What's the best way around this?