Template Class spatial_hash< Tuple< Types… >, std::enable_if_t< (std::is_arithmetic_v< Types >, &&…), void > >

Class Documentation

template<template<class...> class Tuple, class ...Types>
class spatial_hash<Tuple<Types...>, std::enable_if_t<(std::is_arithmetic_v<Types> && ...), void>>

Specialization for tuples.

Public Types

using resolution_in_each_axis_t = std::array<double, sizeof...(Types)>

Type that represents the resolution in each axis.

Public Functions

inline explicit spatial_hash(const resolution_in_each_axis_t &resolution)

Constructs a spatial hasher from an std::array of doubles.

Parameters:

resolution – std::array of doubles containing resolution for each index of the tuple to be hashed, with matching indices. I.e: std::get<0>(tuple) will be hashed with resolution[0].

inline constexpr std::size_t operator()(const Tuple<Types...> &tuple) const

Calculates the array hash, with the resolutions in each axis, given at construction time.

Parameters:

tuple – Tuple to be hashed.

Returns:

The calculated hash.