You just declare a copy constructor with private
access specifier and not even define it.
Anyone trying to use it will get an compile error since it is declared private
.
If someone uses it even indirectly, you will get a link error.
You can't do anything more than that in C++03.
However, In C++11 you can Explicitly delete special member functions.
Eg:
struct NonCopyable {
NonCopyable & operator=(const NonCopyable&) = delete;
NonCopyable(const NonCopyable&) = delete;
NonCopyable() = default;
};