\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.4 - Profiling tools, Hash Map, Union-find, Modifiers
CGAL::Handle_hash_function Struct Reference

#include <CGAL/Handle_hash_function.h>

Definition

The class Handle_hash_function is a model for the UniqueHashFunction concept.

It is applicable for all key types with pointer-like functionality, such as handles, iterators, and circulators. Specifically, for a key value the expression &*key must return a unique address.

Is Model Of:
UniqueHashFunction
See also
CGAL::Unique_hash_map<Key,Data,UniqueHashFunction>

Implementation

Plain type cast of &*key to std::size_t and devided by the size of the std::iterator_traits<Handle>::value_type to avoid correlations with the internal table size, which is a power of two.

Creation

 Handle_hash_function ()
 Default constructor.
 

Operations

template<class Handle >
std::size_t operator() (const Handle &key)
 Returns unique hash value for any Handle type for which &*key gives a unique address. More...
 

Member Function Documentation

◆ operator()()

template<class Handle >
std::size_t CGAL::Handle_hash_function::operator() ( const Handle key)

Returns unique hash value for any Handle type for which &*key gives a unique address.

The type std::iterator_traits<Handle>::value_type has to be defined (which it is already for pointers, handles, iterators, and circulators).