
1 Apr
2005
1 Apr
'05
9:27 a.m.
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<Cond,T>'" (Working with VC7.1, and boost 3.12) Thank you in advance for any suggestions and help. Sincerely yours, Yutaka Leon Suematsu