Disable copy constructor

I have a class: class SymbolIndexer { protected: SymbolIndexer ( ) { } public: static inline SymbolIndexer & GetUniqueInstance ( ) { static SymbolIndexer uniqueinstance_ ; return uniqueinstance_ ; } }; How should I modify it to disable code like: SymbolIndexer symbol_indexer_ = SymbolIndexer::GetUniqueInstance ( ); and only allow code like: SymbolIndexer & ref_symbol_indexer_ = … Read more

What is The Rule of Three?

What does copying an object mean? What are the copy constructor and the copy assignment operator? When do I need to declare them myself? How can I prevent my objects from being copied? 8 Introduction C++ treats variables of user-defined types with value semantics. This means that objects are implicitly copied in various contexts, and … Read more