copy constructors need documentation

Manu turkeyman at gmail.com
Mon Aug 5 09:01:39 UTC 2019


On Mon, Aug 5, 2019 at 12:55 AM RazvanN via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Sunday, 4 August 2019 at 22:16:05 UTC, Manu wrote:
> > Someone needs to write up the documentation for copy
> > constructors.
> > There's no source on how to write them, and explaining how to
> > handle
> > all the different qualifier cases and such.
> > Currently, you have to troll through threads and try and
> > interpret a
> > DIP to work it out... it's not good enough. A user wouldn't
> > even know
> > D has copy constructors by looking at the language reference on
> > dlang.org.
>
> There is this documentation [1] that covers most of the aspects.
> I didn't write too much about qualifiers in that documentation
> because existing overloading and implicit conversion rules apply
> (as stated in the DIP).
>
> Can you point out explicitly what you think is vaguely explained?
>
> [1] https://dlang.org/spec/struct.html#struct-copy-constructor

I'm so sorry, I completely missed that section of doco. It's actually
quite comprehensive.
I don't know why I didn't find it initially when I went looking.
Somehow the organisation didn't get me there.
It's a very tough read though, I had to jump around a lot; like, I was
trying to work out why a qualified constructor works, and that's
detailed in another section (which I still don't understand; how can I
assign to an immutable `this`), but yeah, sorry for the false alarm!


More information about the Digitalmars-d mailing list