|
Boost : |
Subject: Re: [boost] boost::bind C2664 error with two non-const references
From: Nicolas FRANCOIS (nicolas.francois_at_[hidden])
Date: 2015-05-25 04:07:24
Iâm really sorry, all is my own faultâ¦
I declared the signal object with the reference symbol for the std::vectorâ¦
My bad, sorry.
> Le 22 mai 2015 à 16:37, Peter Dimov <lists_at_[hidden]> a écrit :
>
>> 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
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk