Discussion Thread: DIP 1035-- at system Variables--Community Review Round 1
Stanislav Blinov
stanislav.blinov at gmail.com
Wed Jun 10 15:33:14 UTC 2020
On Wednesday, 10 June 2020 at 15:13:57 UTC, Dennis wrote:
> On Wednesday, 10 June 2020 at 12:59:16 UTC, Stanislav Blinov
> wrote:
>> That one is just an incorrect example in the DIP. It
>> uncoditionally trusts a (possibly @system) destructor of T.
>
> That's the point of the example. It shows the problems with
> @trusted constructors and argues for allowing initialization of
> @system variables in @safe code. Note that this was a very late
> addition, so it did not get draft review and could use some
> improvements.
Yes it could, as the example emphasizes the copy ctor but makes
no mention of a dtor :) I.e. the ctor in the example cannot
possibly be explicitly marked @trusted unless @safe-ty of T's
dtor is ascertained first.
More information about the Digitalmars-d
mailing list