Is there a known problem with boost::bind, volatile-qualified member functions and MSVC7.1? The following snippet of
code happily compiles with various incantations of gcc, but fails with MSVC7.1. The same applies for 'const volatile'.
#include
#include
struct TEST
{
void gv0() volatile;
void gvc0() volatile const;
int gv2(int,int) volatile;
int gvc2(int,int) volatile const;
};
void instantiate()
{
TEST T;
boost::function< void() > gv0 =boost::bind(&TEST::gv0,&T);
// boost::function< int(int,int) > gv2 =boost::bind(&TEST::gv2,&T,_1,_2);
// boost::function< void() > gcv0=boost::bind(&TEST::gvc0,&T);
// boost::function< int(int,int) > gcv2=boost::bind(&TEST::gvc2,&T,_1,_2);
}
cl -c -TP -GS -GF -GR -vmv -vmg -EHsc -Zc:forScope -Zc:wchar_t -Op -Gm- -D_DEBUG -Od -Zi -Yd -MDd msvc71bind.cpp
(Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86)
******\boost\mem_fn.hpp(256) : warning C4180: qualifier applied to function type has no meaning; ignored
******\boost\bind\bind_template.hpp(156) : see reference to class template instantiation 'boost::_mfi::dm' being compiled
with
[
R=void (void) volatile,
T=TEST
]
msvc71bind.cpp(21) : see reference to class template instantiation 'boost::_bi::bind_t' being compiled
with
[
R=void (__thiscall &)(void) volatile,
F=boost::_mfi::dm,
L=boost::_bi::list_av_1::type
]
******\boost\mem_fn.hpp(264) : warning C4180: qualifier applied to function type has no meaning; ignored
******\boost\mem_fn.hpp(274) : warning C4180: qualifier applied to function type has no meaning; ignored
******\boost\mem_fn.hpp(288) : warning C4180: qualifier applied to function type has no meaning; ignored
******\boost\mem_fn.hpp(293) : warning C4180: qualifier applied to function type has no meaning; ignored
******\boost\mem_fn.hpp(307) : warning C4180: qualifier applied to function type has no meaning; ignored
******\boost\bind.hpp(1572) : warning C4180: qualifier applied to function type has no meaning; ignored
msvc71bind.cpp(21) : see reference to function template instantiation 'boost::_bi::bind_t boost::bind(void (__thiscall TEST::* ),A1)' being compiled
with
[
R=void (__thiscall &)(void) volatile,
F=boost::_mfi::dm,
L=boost::_bi::list_av_1::type,
A1=TEST *
]
******\boost\mem_fn.hpp(286) : error C4716: 'boost::_mfi::dm::operator()' : must return a value