- Test:
- verify identity based on memory address location, which can be relevant for custom allocation schemes and to prevent self-assignment.
- access to a given entitie's address is used as foundation, with the special twist that a pointer is »unpacked«
- based on this address, an ID-number can be generated
- moreover, two flavours of identity check are provided
- util::isSameObject compares at the level of the language object — it takes its arguments solely by reference and does not »unpack« a pointer. The term object is used here as in the C++ standard
- util::isSameAdr accepts any mix of references and pointers, disregarding any type information, thereby »unpacking« the address information contained in a pointer is (i.e. the address of the pointee is used)
Definition at line 53 of file util-identity-test.cpp.