
On 08/04/11 10:59, Gennadiy Rozental wrote:
Hi,
It's late and I might be missing something, but I can't figure out how can I use enable_if to disambiguate 2 partial specializations where one is subcase of another one:
#include
#include #include #include<iostream>
template
struct M { static void foo() { std::cout<< "generic"<< std::endl; } }; template<typename T> struct M
::type> { static void foo() { std::cout<< "scalar"<< std::endl; } }; template<typename T> struct M
::type> { static void foo() { std::cout<< "enum"<< std::endl; } };
M<FOO>::foo() fails to compile due to ambiguity.
Any pointers? Or How to get what I want?
enum are scalar so :
template<class T>
struct M