Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages

kSize kValue_VHashCode | ( | kType | type,
|  | const void * | value
| ) |  |
| protected

Protected virtual method that calculates a hash code representing the value instance.

The purpose of this method is to generate a hash code that can be used with hash-based collections such as kMap.

The default implementation of this method uses type introspection to generate a hash code that combines the hash codes from individual fields. This approach is not efficient, and may not produce an optimal hash code. Value types can override this method if it is likely that hash codes will be required.

Parameters

  type | Value type.
  value | Value instance pointer.

Returns
  Hash code.