如果一个类型的默认成员被删除,那么这个声明的可访问性是什么呢?
class FooA { public: FooA() = delete; FooA(FooA const&) = delete; FooA& operator=(FooA const&) = delete; } class FooB { private: FooB() = delete; FooB(FooB const&) = delete; FooB& operator=(FooB const&) = delete; } class FooC { protected: FooC() = delete; FooC(FooC const&) = delete; FooC& operator=(FooC const&) = delete; }
解决方法
虽然
accessibility and deletedness are orthogonal,很难看出在你提出的情况下如何有实际的区别.