Loading...
Searching...
No Matches
Public Member Functions | List of all members
bitpit::Element::IdHasher Struct Reference

#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()()

template<typename U >
constexpr std::size_t bitpit::Element::IdHasher::operator() ( U && value) const
inlineconstexprnoexcept

Function call operator that casts the specified value to a size_t.

Template Parameters
Utype of the value
Parameters
valueis 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:
--- layout: doxygen_footer ---