class noncopyable
{
protected:
noncopyable() {}
~noncopyable() {}
private: // emphasize the following members are private
noncopyable( const noncopyable& );
const noncopyable& operator=( const noncopyable& );
};
class D : noncopyable
{
public:
D() { }
D(const D&) { }
};
int main()
{
D a;
D b(a);
return 0;
}
Y2xhc3Mgbm9uY29weWFibGUKewpwcm90ZWN0ZWQ6CiAgbm9uY29weWFibGUoKSB7fQogIH5ub25jb3B5YWJsZSgpIHt9CnByaXZhdGU6ICAvLyBlbXBoYXNpemUgdGhlIGZvbGxvd2luZyBtZW1iZXJzIGFyZSBwcml2YXRlCiAgbm9uY29weWFibGUoIGNvbnN0IG5vbmNvcHlhYmxlJiApOwogIGNvbnN0IG5vbmNvcHlhYmxlJiBvcGVyYXRvcj0oIGNvbnN0IG5vbmNvcHlhYmxlJiApOwp9OwoKY2xhc3MgRCA6IG5vbmNvcHlhYmxlCnsKICAgIHB1YmxpYzoKICAgICAgICBEKCkgeyB9CiAgICAgICAgRChjb25zdCBEJikgeyB9Cn07CgppbnQgbWFpbigpCnsKICAgIEQgYTsKICAgIEQgYihhKTsKCiAgICByZXR1cm4gMDsKfQ==