#include <iostream>
class myclass{
public:
myclass(const myclass &other){std::cout << "copy\n";}
myclass(myclass &&other){std::cout << "move\n";}
myclass(myclass &rhs):
myclass(static_cast<const myclass&>(rhs))
{std::cout << "-> with forward\n";}
template<typename Special>
myclass(Special &&arg){std::cout << "special\n";}
};
int main() {
const myclass c1(42); // special: int
myclass c2(c1); // copy
myclass c3(c2); // copy (with forward)
myclass c4(std::move(c3)); // move
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgbXljbGFzc3sKcHVibGljOgogICAgbXljbGFzcyhjb25zdCBteWNsYXNzICZvdGhlcil7c3RkOjpjb3V0IDw8ICJjb3B5XG4iO30KICAgIG15Y2xhc3MobXljbGFzcyAmJm90aGVyKXtzdGQ6OmNvdXQgPDwgIm1vdmVcbiI7fQoKICAgIG15Y2xhc3MobXljbGFzcyAmcmhzKToKICAgIAlteWNsYXNzKHN0YXRpY19jYXN0PGNvbnN0IG15Y2xhc3MmPihyaHMpKQogICAge3N0ZDo6Y291dCA8PCAiLT4gd2l0aCBmb3J3YXJkXG4iO30KIAoKICAgIHRlbXBsYXRlPHR5cGVuYW1lIFNwZWNpYWw+CiAgICBteWNsYXNzKFNwZWNpYWwgJiZhcmcpe3N0ZDo6Y291dCA8PCAic3BlY2lhbFxuIjt9Cn07CgppbnQgbWFpbigpIHsKICAgIGNvbnN0IG15Y2xhc3MgYzEoNDIpOyAgICAgIC8vIHNwZWNpYWw6IGludAogICAgbXljbGFzcyBjMihjMSk7ICAgICAgICAgICAgLy8gY29weQogICAgbXljbGFzcyBjMyhjMik7ICAgICAgICAgICAgLy8gY29weSAod2l0aCBmb3J3YXJkKQogICAgbXljbGFzcyBjNChzdGQ6Om1vdmUoYzMpKTsgLy8gbW92ZQogICAgCgp9