When defining a class, is the following valid?
T(const T&&) = default;
I was reading about move constructors here and it explains how the default may still be implicitly declared:
A class can have multiple move constructors, e.g. both
T::T(const T&&)andT::T(T&&). If some user-defined move constructors are present, the user may still force the generation of the implicitly declared move constructor with the keyword default.
At the bottom of the page it mentions defect report CWG 2171:
CWG 2171 C++14
X(const X&&) = defaultwas non-trivial, made trivial.
Maybe the wiki entry just has a mistake and CWG 2171 is only referring to a copy constructor, not a move constructor?
X(const X&&) = default? - wallyX&&from being non-user-provided. - T.C.