Skip to main content

hash Struct Template

Hash specialization for EntityHandle. More...

Declaration

template <typename TStrongId> struct std::hash<helios::ecs::types::EntityHandle< TStrongId >> { ... }

Public Operators Index

template <typename TStrongId>
std::size_toperator() (const helios::ecs::types::EntityHandle< TStrongId > &handle) const noexcept

Description

Hash specialization for EntityHandle.

Packs entityId and versionId into a 64-bit value for hashing.

Definition at line 116 of file EntityHandle.ixx.

Public Operators

operator()()

template <typename TStrongId>
std::size_t std::hash< helios::ecs::types::EntityHandle< TStrongId > >::operator() (const helios::ecs::types::EntityHandle< TStrongId > & handle)
inline noexcept

Definition at line 117 of file EntityHandle.ixx.

117 std::size_t operator()(const helios::ecs::types::EntityHandle<TStrongId>& handle) const noexcept {
118
119 const uint64_t packed = (static_cast<uint64_t>(handle.entityId) << 32) |
120 static_cast<uint64_t>(handle.versionId);
121
122 return std::hash<uint64_t>{}(packed);
123 }

The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.