22 May
2015
22 May
'15
2:37 p.m.
Nicolas FRANCOIS wrote:
Does BOOST_NO_CXX11_RVALUE_REFERENCES is defined ?
No. This is what I'm compiling: ...
I changed it to call the function. Still works. #include <boost/bind.hpp> #include <boost/function.hpp> #include <vector> #include <iostream> #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES #error #endif struct A { void f( int& x, std::vector<int*>& v ) { v.push_back( &x ); } }; int main() { A a; auto f = boost::bind(&A::f, &a, _1, _2); int x; std::vector<int*> v; f( x, v ); std::cout << &x << "; " << v.front() << std::endl; } Output: 0024F898; 0024F898