I have shared pointers to an interface created through out the program. I also have a list of weak pointers to their implementations in order to call internal update function. The program works, but when I compile it I get warning C4180. The question is, how to get rid of it?
#include <vector>
#include <algorithm>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/bind.hpp>
int main(int argc, char **argv){
struct Iface{};
struct Imp: public Iface{ void Do(){} };
typedef boost::shared_ptr<Iface> TIf;
typedef boost::weak_ptr<Imp> TMonitor;
typedef std::vector<TMonitor> TMonitors;
TMonitors m;
std::for_each(
m.begin(),
m.end(),
boost::bind(&Imp::Do,
boost::bind(&TMonitor::lock, _1)));
return 0;
}
The warning is:
c:\src\boost_1_34_1\boost/bind.hpp(1575) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\src\boost_1_34_1\boost/bind.hpp(1609) : see reference to class template instantiation 'boost::_bi::add_cref<Pm,I>' being compiled
with
[
Pm=boost::shared_ptr<main::Imp> (__thiscall boost::weak_ptr<main::Imp>::* )(void),
I=1
]
.\main.cpp(29) : see reference to class template instantiation 'boost::_bi::dm_result<Pm,A1>' being compiled
with
[
Pm=boost::shared_ptr<main::Imp> (__thiscall boost::weak_ptr<main::Imp>::* )(void),
A1=boost::arg<1>
]