What is the output of the following C++ program on a 64-bit system?
#include <iostream>
#include <utility>
struct W {
W() = default;
W(const W&) { std::cout << "C"; }
W(W&&) noexcept { std::cout << "M"; }
};
W make() { return W(); }
int main() {
W a;
W b(a);
W c(std::move(a));
W d(make());
W e(std::move(b));
std::cout << '\n';
return 0;
}
b copies a, c and e are moves. d is built directly from the prvalue returned by make() – guaranteed elision, so nothing is printed.