On Tuesday, 17 November 2015 at 19:44:36 UTC, Ali Çehreli wrote:
    if (typeid(a) == typeid(b)) return a.opEquals(b);

Wow this is terrible to compare two objects in D. The line I quoted means that two TypeInfoClass are likely to be allocated, right ?

But usually when comparing objects one rather cares about the reference itself, so a comparison of the two heap addresses is enough in this case. (meaning same or not same instance, regardless of the their members values).


Reply via email to