1. The core of prohibiting the copying of class members is that copying functions, including "copy constructor" and "operator = overloading", are not allowed to be seen outside the class.
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
private: \
TypeName(const TypeName&); \
TypeName& operator=(const TypeName&)
2. If implicit construction is prohibited, the default constructor can be hidden. In most compilers, the explicit keyword can also be added to the constructor to avoid implicit construction.
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
private: \
TypeName(); \
DISALLOW_COPY_AND_ASSIGN(TypeName)
For more explanation, see "More Effective C++"
3. The boost::noncopyable class that can inherit the Boost library implements similar functions.