
11 Oct
2007
11 Oct
'07
9:08 a.m.
Johan Torp:
The following code compiles fine in MSVC 8.0 and gcc 3.4.4 but MSVC 7.1 renders the errors found below.
struct X { template<class T> void bar() {} };
void foo() { X x; boost::bind(&X::bar<int>, x); }
I'm using boost 1.34.0. Is this a known problem of MSVC 7x?
Function templates have been known to confuse earlier versions of MSVC. I don't think that this specific problem has been known, but now it is. :-) The usual workaround is to help the compiler by using void (X::*pmf) () = &X::bar<int>;