Copy Constructor DIP

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Jul 10 11:58:53 UTC 2018


On Tuesday, 10 July 2018 04:52:18 MDT Guillaume Piolat via Digitalmars-d 
wrote:
> On Tuesday, 10 July 2018 at 10:47:04 UTC, RazvanN wrote:
> > Hi everyone!
> >
> > I managed to put together a first draft of the DIP for adding
> > the copy constructor to the language [1]. If anyone is
> > interested, please take a look. Suggestions and comments about
> > technical aspects and wording are all welcome.
> >
> > Thanks,
> > RazvanN
> >
> > [1] https://github.com/dlang/DIPs/pull/129
>
> Does it allow to remove the "T.init must always be valid for
> structs" rule?

Why would it? init is the state of the object before any constructor runs,
and quite a few things rely on it. The fact that we've allowed default
initialization to be disabled already causes plenty of problems as it is.
It's occasionally useful, but it definitely complicates things. D was
designed with the idea that every type has an init value.

What problem are you trying to solve here?

- Jonathan M Davis





More information about the Digitalmars-d mailing list