[move] Where is it? when to use it?

Hello, Okay, this is kind of a Boost question, and kind of not. Kind of a C++ question, and kind of not. Depends where I can find a workable solution. First, I am using Sourcery CodeBench in a more recent (not the most recent) version. I believe it is one revision back from most recent. Targeting (Arch)Linux/ARM. I believe I answered my question from online references: http://en.cppreference.com/w/cpp/utility/move, which I've also confirmed is a C++0x experimental feature in the version of CodeBench I am using. It may be more or less up to date when I upgrade to the latest CodeBench. If the experimental doesn't work out, is there a Boost alternative? If so, where do I include it? Thank you... Regards, Michael Powell

Regarding the questions in the subject, I discuss "where" below.
When you ask about "when", however, do you mean:
a. When would one want to use Boost.Move over std::move (if ever)?
b. When would one use move() at all?
The former is also addressed below. Point (b) is covered in many
places on the web, e.g.:
http://thbecker.net/articles/rvalue_references/section_01.html
http://stackoverflow.com/questions/3106110/what-is-move-semantics
If you have specific questions left unanswered, go ahead and ask them.
Michael Powell
I believe I answered my question from online references: http://en.cppreference.com/w/cpp/utility/move, which I've also confirmed is a C++0x experimental feature in the version of CodeBench I am using. It may be more or less up to date when I upgrade to the latest CodeBench.
Move support has been stable in gcc for a long while now. You can check support for individual features here: http://gcc.gnu.org/projects/cxx0x.html The actual feature name to look for is "rvalue references".
If the experimental doesn't work out, is there a Boost alternative? If so, where do I include it?
Now you're just getting lazy. :) First hit for "boost move" on google: http://www.boost.org/doc/libs/1_54_0/doc/html/move.html Having said that, you shouldn't need it; just use "-std=c++11" when you're compiling ("-std=c++0x" for slightly older GCCs, maybe 4.6 needs that?) On top of that, it won't save you if a library requires C++11 move capabilities; Boost.Move *emulates* those, but since the C++11 support includes changes to syntax, the library requiring C++11 syntax won't compile under C++03. Unless it's a library that knows about Boost.Move, as many Boost librarys do, but since you should have pretty good C++11 'move' support in g++ already, it's an entirely moot point. Happy hacking, Anthony Foiani
participants (2)
-
Anthony Foiani
-
Michael Powell