Copy Constructor DIP

Manu turkeyman at gmail.com
Wed Jul 18 01:03:10 UTC 2018


On Tue, 17 Jul 2018 at 10:20, aliak via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Friday, 13 July 2018 at 12:31:41 UTC, Atila Neves wrote:
> > On Friday, 13 July 2018 at 03:01:25 UTC, Manu wrote:
> >> On Thu, 12 Jul 2018 at 19:15, Andrei Alexandrescu via
> >> Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> >>>
> >>> On 7/12/18 6:34 PM, Manu wrote:
> >>> > On Thu, 12 Jul 2018 at 06:50, Andrei Alexandrescu via
> >>> > Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> >>> >>
> >> [..]
> >> doesn't perform copy construction?
> >>   1. the function is highly unlikely to exist because
> >> postblit; it's a
> >> meaningless function to write. are there any known instances
> >> of that
> >> signature in the wild?
> >
> > https://github.com/search?q=%22this%5C%28ref%22+language%3AD&type=Code
> >
> > The answer seems to be: not many. Most of the results above are
> > false positives because github won't let me escape the left
> > parenthesis.
> >
> > Atila
>
> https://www.google.no/search?q=allintext%3A+%22this%28ref%22+site%3Agithub.com+filetype%3Ad&oq=allintext%3A+%22this%28ref%22+site%3Agithub.com+filetype%3Ad

I clicked through quite a few. Every function that's a valid copy
constructor by the definition here does indeed perform a valid copy
construction with no side-effects, as predicted. Existing functions
interpreted as copy constructors under this DIP would continue to work
as intended.
There's a ridiculously low probability that any such wild function
that would be broken by a no-attribute version of this DIP exists.


More information about the Digitalmars-d mailing list