#include <element.hpp>
Public Member Functions | |
template<typename U > | |
constexpr std::size_t | operator() (U &&value) const noexcept |
Hasher for the ids.
Since ids are unique, the hasher can be a function that takes an id and cast it to a size_t.
The hasher is defined as a struct, because a struct can be passed as an object into metafunctions (meaning that the type deduction for the template paramenters can take place, and also meaning that inlining is easier for the compiler). A bare function would have to be passed as a function pointer. To transform a function template into a function pointer, the template would have to be manually instantiated (with a perhaps unknown type argument).
Definition at line 68 of file element.hpp.
|
inlineconstexprnoexcept |
Function call operator that casts the specified value to a size_t.
U | type of the value |
value | is the value to be casted |
Definition at line 78 of file element.hpp.