On Monday, 5 September 2016 09:23:00 UTC+3, Juha Nieminen wrote:
> Öö Tiib <
oot...@hot.ee> wrote:
> > Does anyone know why the language was designed to create implicitly
> > functions that are detectable to be likely wrong by so simple check?
> > The checks about if something is "trivial" or "standard layout" seem
> > far more complicated. Also, if it was design error then why it
> > hasn't been repaired?
>
> There are valid situations where you may want to define only one of them
> without any need to define the others (ie. not defining the others will
> not break anything).
In one of such situations we would need to explicitly default the others
if we wanted those. It seems rather slight inconvenience. Far better than
current situation where we have the likely wrong implicit defaults unless
we explicitly delete those.
>
> On that subject, one feature I would like to see is the ability to call
> the compiler-generated default implementation from your own. (This could
> be especially useful in copy constructors and assignment operators.)
I would like automatic run-time detection of object slicing when there
are virtual functions. It feels quite cheap to achieve comparable with
virtual function call instead of non-virtual. Unfortunately there's
still some months left until Christmas. ;)