|
Boost Users : |
Subject: Re: [Boost-users] Moving an std::string into a boost::thread in C++03
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2012-10-04 05:30:14
2012/10/4 Adi Shavit <adishavit_at_[hidden]>:
> Hi,
>
>
> How can I [boost::]move() veryLongString into the boost::thread ctor
> (probably using via boost::bind)?
> Is this possible?
>
Hi, Adi
sorry, bind() can only do as much also - either doing a copy of a
std::string or using a reference to it.
As you mentioned, you have to use shared_ptr<> to pass ownership or
use boost::container::string which is movable (even in 03 compilers
via boost.move emulation) instead of std::string.
Cheers,
Szymon
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