Copy Constructor DIP
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Jul 13 02:14:22 UTC 2018
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:
>>
>> On 07/11/2018 11:11 AM, Atila Neves wrote:
>>> On Wednesday, 11 July 2018 at 07:40:32 UTC, RazvanN wrote:
>>>>> But there's a super explicit `@implicit` thing written right there...
>>>>> so should we expect that an *explicit* call to the copy constructor
>>>>> is not allowed? Or maybe it is allowed and `@implicit` is a lie?
>>>>
>>>> The @implicit is there to point out that you cannot call that method
>>>> explicitly; it gets called for you implicitly when you construct an
>>>> object
>>>> as a copy of another object.
>>>
>>> How is this different from other types of constructors or destructors?
>>
>> The main difference is that the compiler may insert calls to it implicitly.
>
> You mean like ~this(), and op[Anything](), and front() and popFront()
> and empty()?
> I don't think we need this attribute.
I mentioned this, and patiently will mention it again: we need to
introduce the attribute so as to avoid silently changing the semantics
of existing code.
More information about the Digitalmars-d
mailing list