2009/11/26 Piotr Wyderski:
>
> Clean, simple and GCC used to happily accept that.

Only with the experimental C++0x mode, which is a moving target and
you shouldn't really complain if it changes.

> But now it is illegal because of 3 draft violations:
>
> Base() shall be public, but is not
> ~Base() shall be public, but is not
> ~Base() shall not be virtual, but it is
>
> IMHO this severely cripples defaulted functions,
> making them almost useless -- the set of allowed
> cases is too narrow. Is there any chance to fix the DR?

It's under discussion, but relax, notice it says "If it is explicitly
defaulted on its first declaration,"

Have you tried:

class Base {
protected:

    Base();
    virtual ~Base();
};

inline Base::Base() = default;
inline Base::~Base() = default;

This still lets you use defaulted functions, but the base is not
trivially copyable. (I haven't tested this with GCC, but I believe it
should work.)

Reply via email to