Hi,
Visual Studio 2005 gives me warning C4180 ("qualifier applied to
function type has no meaning; ignored") when binding member functions
that has a templatized type as return type with boost::bind, but I can't
see any reason why it should. The following example reproduces the warning:
#include
template <typename T> struct Foo {};
struct Bar {
Foo<void> f() { return Foo<void>(); }
int g() { return 0; }
};
Foo<void> f() { return Foo<void>(); }
int main(int argc, const char **argv) {
Bar b;
boost::bind(&Bar::f, &b); // Warning C4180 (see below)
boost::bind(&Bar::g, &b); // No warning
boost::bind(f); // No warning
return 0;
}
So far as I have tested, the program appears to function properly. The
full warning is as follows (paths shortened):
C:\...\boost/bind.hpp(1575) : warning C4180: qualifier applied to
function type has no meaning; ignored
C:\...\boost/bind.hpp(1609) : see reference to class template
instantiation 'boost::_bi::add_cref' being compiled
with
[
Pm=Foo<void> (__thiscall Bar::* )(void),
I=1
]
..\..\..\src\main.cpp(14) : see reference to class template
instantiation 'boost::_bi::dm_result' being compiled
with
[
Pm=Foo<void> (__thiscall Bar::* )(void),
A1=Bar *
]
GCC 4.1.2 on Linux compiles the code without warnings. Any insights are
greatly appreciated!
Best regards,
Josef Grahn