On Fri, Feb 6, 2009 at 10:30 AM, Robert Dailey <rcdailey@gmail.com> wrote:
Hi,

I'm currently using std::back_inserter on a ptr_vector, and the values being inserted are boost::unique_ptr's. back_inserter does simple assignment but I need it to call boost::move() on the thing being assigned (inserted). Does boost have an algorithm that can do this?

I think I'm getting confused. Maybe std::transform needs to move instead of copy. I'm doing this:

        std::transform(
            definition.tiles.begin(),
            definition.tiles.end(),
            std::back_inserter( tiles ),
            boost::bind( &TileFactory::Create, _1, boost::ref( textures ) )
            );

TileFactory::Create() returns a boost::unique_ptr. This fails because std::transform cannot simply do assignment, it must call move() on the rvalue.