#include #include class Foo : private boost::noncopyable { public: Foo(const std::string name) : m_name(name) { std::cout << "constructor\n"; } Foo(const Foo &other) { m_name = other.m_name + "'"; std::cout << "copy-constructor\n"; } void print() { std::cout << "<" + m_name + ">\n"; } private: int a; std::string m_name; }; int main() { std::cout << "Hello World\n"; Foo f("f"); std::cout << "Now copy the thing\n"; Foo g(f); g.print(); }