On Sunday, 22 January 2017 at 00:31:38 UTC, Ali Çehreli wrote:
On 01/21/2017 03:36 PM, Ali Çehreli wrote:

> Change the signature and it works without copies:
>
>     this(const(this)) {
>         // ...
>     }

Ugh... :( It's not a post-blit. Then what is it?

Ali

This is a __ctor that takes another instance as param. The param name is not specified, i.e

struct Foo
{
    this(const(this)){}
}

is the same as

struct Foo
{
    this(const(this) param){}
}

since __PRETTY__FUNCTION__ in the function returns

    "Foo Foo.this(const(Foo) _param_0) ref"

That's strange.
Isn't it mentioned somewhere in the specification that within a function declaration, "this" resolves to the type of the current aggregate ?

Reply via email to