Copy Constructor DIP and implementation

Dejan Lekic dejan.lekic at gmail.com
Wed Sep 12 11:39:21 UTC 2018


On Tuesday, 11 September 2018 at 15:22:55 UTC, rikki cattermole 
wrote:
>
> Here is a question (that I don't think has been asked) why not 
> @copy?
>
> @copy this(ref Foo other) { }
>
> It can be read as copy constructor, which would be excellent 
> for helping people learn what it is doing (spec lookup).
>
> Also can we really not come up with an alternative bit of code 
> than the tupleof to copying wholesale? E.g. super(other);

I could not agree more. @implicit can mean many things, while 
@copy is much more specific... For what is worth I vote for @copy 
! :)


More information about the Digitalmars-d-announce mailing list