
VC7 bug: static member templates
Carl: this is a bug in the
Visual C++ 7.0 compiler. I have added it to our
bug database and we will endeavor to have it fixed in the next release.
Thanks for taking the time to report this issue.
--
Jonathan Caves
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Quote:
> The following code does not compile under VC7, it should.
> class X
> {
> public:
> template <typename T>
> static void f(int) { }
> typedef void (*pf)(int);
> void g(pf) {};
> void h()
> {
> g(f<int>); // 1
> }
> };
> VC7 complains (at //1) that f<int> cannot be converted to X::pf (aka void
> (*)(int)), which it clearly can be. Apparently VC7 ignores the static
> keyword when used with a member template function - a combination which
> should be legal according to the standard.
> -cd