#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
class C {
public:
C() {cout<<"CTOR\n";}
~C() {cout<<"DTOR\n";}
C(const C& c) { cout<<"COPY CTOR\n";};
C(const C&& c) { cout<<"MOVE CTOR\n";};
};
int main() {
{
queue<C> c;
C cobj;
//cout<<"pushing normally:\n";
//c.push(cobj);
cout<<"pushing with move\n";
c.push(move(cobj)); // same output as line above
cout<<"popping\n";
c.pop();
//c.pop();
cout<<"end of scope\n";
}
//cin.get();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cXVldWU+CiNpbmNsdWRlIDxhbGdvcml0aG0+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQyB7CnB1YmxpYzoKICAgIEMoKSB7Y291dDw8IkNUT1JcbiI7fQogICAgfkMoKSB7Y291dDw8IkRUT1JcbiI7fQogICAgQyhjb25zdCBDJiBjKSB7IGNvdXQ8PCJDT1BZIENUT1JcbiI7fTsKICAgIEMoY29uc3QgQyYmIGMpIHsgY291dDw8Ik1PVkUgQ1RPUlxuIjt9OwoKfTsKCmludCBtYWluKCkgewoKICAgIHsKICAgICAgICBxdWV1ZTxDPiBjOwogICAgICAgIEMgY29iajsKICAgICAgICAvL2NvdXQ8PCJwdXNoaW5nIG5vcm1hbGx5OlxuIjsKICAgICAgICAvL2MucHVzaChjb2JqKTsKICAgICAgICBjb3V0PDwicHVzaGluZyB3aXRoIG1vdmVcbiI7CiAgICAgICAgYy5wdXNoKG1vdmUoY29iaikpOyAvLyBzYW1lIG91dHB1dCBhcyBsaW5lIGFib3ZlCiAgICAgICAgY291dDw8InBvcHBpbmdcbiI7CiAgICAgICAgYy5wb3AoKTsKICAgICAgICAvL2MucG9wKCk7CiAgICAgICAgY291dDw8ImVuZCBvZiBzY29wZVxuIjsKCX0KCS8vY2luLmdldCgpOwp9