访问Base中的受保护副本ctor

时间:2015-01-16 10:01:38

标签: c++ gcc visual-c++ intellisense

GCC和MSVC接受以下片段,但Intellisense(EDG)抱怨:

class Base {
protected:
    Base(Base const&) { }
};


class Derived : public Base {
// Error: protected function Base::base(const Base&) ... is not accessible
// through a "Base" pointer or object.
public:
    Derived(Derived const& src) = default;
};

奇怪的是,接受了等效代码: Base(src) { }

Intellisense是否有权拒绝违约复制件?

0 个答案:

没有答案