I was looking at this answer regarding What are the rules for automatic generation of move operations?, and am hopeful that the answer has now been well established by now.
The slide that shows what constructors/assignment operators are "not declared", "defaulted" or "deleted", based on what has been declared in the class, shows:
That was taken from these slides, with the red squares meaning that this behaviour is deprecated.
When compiling the following:
#include <iostream>
struct X
{
template<typename...T>
X(T&&...) {
std::cout << "Yay!\n";
}
~X() {}
};
int main() {
X x0;
X x1{x0};
X x2{std::move(x0)};
}
It would appear that they have been "not declared", since it compiles and the output is "Yay!" three times (which is good, at least for me). But I want to confirm that I can rely on this behaviour.
Edit
It has been pointed out by Frank that, if a copy constructor is also added, it still says "Yay!" three times, which is interesting behaviour. Doing further testing, if a move constructor is added, it will only say "Yay!" twice. Can anyone explain this behaviour?