Jonathan Wakely wrote:
> This is DR906
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#906
Thanks.
> Note "it shall be public"
And what's the reason for such restrictions?
I've used the following construction as a very
useful idiom to create an abstract class:
class Base {
protected:
Base() = default;
virtual ~Base() = default;
};
class Derived : public Base {
public:
Derived() { ... }
virtual ~Derived() { ... }
};
Clean, simple and GCC used to happily accept that.
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?
Best regards
Piotr Wyderski