How to use/manipulate return value from nested boost::bind

Posted by JQ on Stack Overflow See other posts from Stack Overflow or by JQ
Published on 2010-04-16T04:30:47Z Indexed on 2010/04/16 4:33 UTC
Read the original article Hit count: 354

Filed under:
|

I have two functions: 1. A & DataSource(); 2. void DataConsumer( A * );

What I want to achieve: Using one statement to assemble them into one functor.

I have tried:

1. boost::function< void()> func( boost::bind( DataConsumer, & boost::bind( DataSource ) ) );

certainly it didn't work, compiler says it can not convert 'boost::_bi::bind_t ' to 'A *'

2. boost::function< void()> func( boost::bind( DataConsumer, boost::addressof( boost::bind( DataSource ) ) ));

compiler says cannot convert parameter 1 from 'boost::_bi::bind_t' to 'A &'

Question: how to use return value from the nested boost::bind ? or if you want to use boost::lambda::bind.

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost-bind