Tag Move
Switch to force move.

Defined in <seqan/align.h>
Signature typedef Tag<Move_> Move;

Detailed Description

The difference between move constructor and copy constructor is that the source object is not copied but moved into the target object. The source object can lose its content and will be empty after this operation in this case. A move constructor can sigificantly faster than a copy constructor.


String source("hello");
String target(source, Move()); // source is moved to target
std::cout << source; //nothing printed since source lost content
std::cout << target; //"hello"

Move constructors are like copy-constructors. However, their argument is not const.

class Klass
    seqan::String m;
    // Copy constructor, other is left untouched.
    Klass(Klass const & other) { ... }
    // Move constructor, leaves other and its members in an "empty" state.
    Klass(Klass & other, seqan::Move const &) { ... }

See Also