Disallowing class copying in C++
<p>When I want to disallow <em>class copy</em> in C++, I usually declare a <strong>private operator=</strong> and a <strong>copy constructor</strong> and I don't implement them:</p>

<pre><code>class MyClass
{
  char* _str;
  int _len;
  MyClass(const MyClass&amp; rhs);            //No implementation
  MyClass&amp; operator=(const MyClass&amp; rhs); //No implementation
public:
  MyClass();
  MyClass(const char *);
}
</code></pre>

<p>Is this considered a bad style? Is there another way to do this?</p>
