Does the && and in the parameters mean that this is a move constructor?
Vertex(int&& val, float&& dis)
: value_(std::move(val)), distance_(std::move(dis)),
known_(false), previous_in_path_(nullptr)
{}
Do all move constructors have to have a parameter that is an object of the same class as the constructor is in? Like this?
Vertex(Vertex&& rhs)
: value_(std::move(rhs.value_)), distance_(std::move(rhs.distance_)),
known_(false), previous_in_path_(nullptr)
{}
I just need clarification as to what is and what isn't a move constructor.
class_name(class_name&&)Blah&& blahmeans that theblahobject is capable & allowed to be moved. The argument passed to the parameter has not been moved yet. That occurs with a move-constructor or move-assignment — which is not required to happen, which in that case will leave the caller's argument not-moved.