[Issue 13506] std.array.array is not @safe in some cases

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 21 16:26:59 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13506

--- Comment #6 from bearophile_hugs at eml.cc ---
(In reply to hsteoh from comment #5)
> Actually, it looks like it's probably the *wrong* fix, because if appender
> is used with a type with overloaded assignment operator, and the assign
> operator was un- at safe, then this patch will cause unsafe code to be called
> from @trusted code, so it will break @safety in a subtle but fairly horrible
> way.

Yours was a first try, don't worry. Can you verify at compile time the safety
of the assignment, and use a safe or a not safe nested lambda accordingly with
a static if?

--


More information about the Digitalmars-d-bugs mailing list