Why is `opequals` for objects not `@safe` by default?

Nick Treleaven nick at geany.org
Mon Apr 8 08:29:09 UTC 2024


On Sunday, 7 April 2024 at 21:05:14 UTC, Liam McGillivray wrote:
> default. The only place where they would differ is when the 
> first reference is null, right?

No. Maybe you missed Jonathan's example?:

auto a = new C(42);
auto b = new C(42);

then

assert(a is b);

would fail, whereas

assert(a == b);

would pass.


More information about the Digitalmars-d mailing list