Boost logo

Boost Users :

Subject: Re: [Boost-users] using bind with operator new
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-05-19 17:52:56


AMDG

Archie14 wrote:
> I am trying to use bind to generate ptr_vector list of objects from another
> vector
>
> #include <boost/shared_ptr.hpp>
> #include <boost/bind.hpp>
>
>
>
> boost::bind((&listofb::push_back), lstb,
> boost::bind((&operator new), b, _1)
> );
>

You'll most likely do better using Boost.Lambda.

boost::lambda::bind(&listofb::push_back, lstb,
boost::lambda::bind(boost::lambda::new_ptr<b>(_1)))

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net