我有一门课:
class SymbolIndexer {
protected:
SymbolIndexer ( ) { }
public:
static inline SymbolIndexer & GetUniqueInstance ( )
{
static SymbolIndexer uniqueinstance_ ;
return uniqueinstance_ ;
}
};
我应该如何修改它来禁用如下代码:
SymbolIndexer symbol_indexer_ = SymbolIndexer::GetUniqueInstance ( );
并且只允许这样的代码:
SymbolIndexer & ref_symbol_indexer_ = SymbolIndexer::GetUniqueInstance ( );