#include <element.hpp>
Public Member Functions | |
template<typename U> | |
constexpr std::size_t | operator() (U &&value) const noexcept |
Detailed Description
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.
Member Function Documentation
◆ operator()()
|
inlineconstexprnoexcept |
Function call operator that casts the specified value to a size_t.
- Template Parameters
-
U type of the value
- Parameters
-
value is the value to be casted
- Returns
- Returns the value casted to a size_t.
Definition at line 78 of file element.hpp.
The documentation for this struct was generated from the following file:
- src/patchkernel/element.hpp
