|
Boost : |
Subject: Re: [boost] [function] Problem copying when constructed with a functor
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-05-23 20:50:11
AMDG
On 05/23/2011 05:31 PM, Edward Diener wrote:
> This simple code:
>
> #include <boost/detail/lightweight_test.hpp>
> #include <boost/function.hpp>
>
> struct p_functor_class_int
> {
> p_functor_class_int() : data(50) { }
> int operator()() const { return data; }
> void operator()(int d) { data = d; }
> int data;
> };
>
> int main()
> {
> boost::function<int ()> bfun(p_functor_class_int());
Q: What is bfun?
A: A function that takes a p_functor_class_int and returns
a boost::function<int()>.
> boost::function<int ()> bfun2(bfun);
> return boost::report_errors();
> }
>
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk