expanded class SAFE_EQUAL [E]

Features exported to ANY

The goal of this class is to share the definition of the feature safe_equal. The feature safe_equal compares two arguments of type E, by calling is_equal only if both arguments have the same_dynamic_type.

Direct parents

non-conformant parents

ANY

Known children

conformant children

COLLECTION2, COLLECTION3

non-conformant children

NATIVE_ARRAY, SET

Summary

exported features

Details

test (e1: E, e2: E): BOOLEAN

In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type. Furthermore, this feature avoids argument passing from some expanded type to the corresponding reference type (no automatic allocation of some reference type during the comparison).

safe_equal (e1: E, e2: E): BOOLEAN

In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type. Furthermore, this feature avoids argument passing from some expanded type to the corresponding reference type (no automatic allocation of some reference type during the comparison).