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.
From the Move constructors documentation:
(emphasis is mine)
This means that in order to be a move constructor, the first parameter must be a rvalue reference (potentially const/volatile) to the same type.
You can add additional parameters, but they must have default values.
Therefore your 1st constructor is not a move constructor, but the 2nd one is.