Boost logo

Boost Users :

Subject: Re: [Boost-users] Moving an std::string into a boost::thread in C++03
From: Adi Shavit (adishavit_at_[hidden])
Date: 2012-10-04 06:39:42


Hi Kris,

  Since I don't have C++11, I don't have auto but I tried this and it works.
I guess I was hoping for a more (meta-)magical solution that allows bind to
automatically create a move-copy or something...

Thanks!
Adi

> auto p = make_shared<string>();
> p->swap( veryLongString );
> And now you have a shared pointer with moved contents of veryLongString
> ;-)
> Regards,
> Kris
>
>



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