Hello Yutaka,
The problem is that T is not a template parameter of you function f1.
It is a template parameter of the class A. So when the class A
is instantiated with some type that is not arithmetic, say void*,
it is as if you would directly write a function:
enable_if
Dear booster,
I have a question related to enable_if. I would like to enable or disable some member functions from a template class, but enable_if is -not enable- to do it :-)
Here is the code.
template <class T> class A { ... enable_if< boost::is_arithmetic<T>, void > :: type f1() { ... } };
In class A, I want to define function f1 only if the template parameter is arithmetic. It works fine except when the parameter is not arithmetic. I have a compile error "error C2039: 'type' : is not a member of 'boost::enable_if
'" (Working with VC7.1, and boost 3.12) Thank you in advance for any suggestions and help.
Sincerely yours,
Yutaka Leon Suematsu
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Jaakko Järvi, Assistant Professor -- Texas A&M University, Computer Science -- jarvi@cs.tamu.edu