I don't have access to VC++ 7.1 right now, so I can't find the whole problem you're having, but I have one comment: the uses of typename before is_arithmetic and is_object are unnecessary, since the types you're accessing are not members. I don't know if it will solve your ICE problem, but try removing those uses of typename. Otherwise, try using enable_if_c and adding ::value after the conditions (but still without a typename inside the condition for enable_if_c). Jeremiah Willcock On Sat, 18 Dec 2004, Agoston Bejo wrote:
Has anyone succeeded in specializing class templates with enable_if under VC++7.1? I have created the simplest example possible and cannot imagine how I could rewrite so that no Internal Compiler Error occurs. I have tried with both the boost 1.31 and 1.32 headers, with no difference.
------------------------------------------------------
#include <iostream> #include
#include using namespace std; using namespace boost;
template
struct A { enum { X = 0 }; }; template<typename T> struct A
::type> { enum { X = 1 }; }; template<typename T> struct A
::type> { enum { X = 2 }; }; struct B {};
int _tmain(int argc, _TCHAR* argv[]) { // cout << is_arithmetic<double>::value << endl; typedef A<float> Afloat; cout << Afloat::X << endl; // Internal Compiler Error cout << A<int>::X << endl; cout << A<B>::X << endl; return 0; }
------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users