Standard library » Functional module

Part of the standard function objects library.

It provides the standard hash function.

Files

file bn_functional.h

Classes

template<>
struct bn::hash<affine_bg_map_ptr>
Hash support for affine_bg_map_ptr.
template<>
struct bn::hash<affine_bg_mat_attributes_hbe_ptr>
Hash support for affine_bg_mat_attributes_hbe_ptr.
template<>
struct bn::hash<affine_bg_ptr>
Hash support for affine_bg_ptr.
template<>
struct bn::hash<affine_bg_tiles_ptr>
Hash support for affine_bg_tiles_ptr.
template<>
struct bn::hash<bg_palette_ptr>
Hash support for bg_palette_ptr.
template<>
struct bn::hash<camera_ptr>
Hash support for camera_ptr.
template<>
struct bn::hash<color>
Hash support for color.
template<>
struct bn::hash<dmg_music_item>
Hash support for dmg_music_item.
template<>
struct bn::hash<dmg_music_position>
Hash support for dmg_music_position.
template<int Precision>
struct bn::hash<fixed_t<Precision>>
Hash support for fixed_t.
template<int Precision>
struct bn::hash<fixed_point_t<Precision>>
Hash support for fixed_point_t.
template<int Precision>
struct bn::hash<fixed_rect_t<Precision>>
Hash support for fixed_rect_t.
template<int Precision>
struct bn::hash<fixed_size_t<Precision>>
Hash support for fixed_size_t.
template<typename Type>
class bn::equal_to
Function object for performing comparisons using the equal operator.
template<typename Type>
class bn::less
Function object for performing comparisons using the less than operator.
template<typename Type>
struct bn::hash
Hash function object.
template<>
struct bn::hash<unsigned>
Hash support for unsigned.
template<>
struct bn::hash<bool>
Hash support for bool.
template<>
struct bn::hash<char>
Hash support for char.
template<>
struct bn::hash<int8_t>
Hash support for int8_t.
template<>
struct bn::hash<uint8_t>
Hash support for uint8_t.
template<>
struct bn::hash<int16_t>
Hash support for int16_t.
template<>
struct bn::hash<uint16_t>
Hash support for uint16_t.
template<>
struct bn::hash<int>
Hash support for int.
template<typename Type>
struct bn::hash<Type*>
Hash support for pointers.
template<>
struct bn::hash<int64_t>
Hash support for int64_t.
template<>
struct bn::hash<uint64_t>
Hash support for uint64_t.
template<>
struct bn::hash<float>
Hash support for float.
template<>
struct bn::hash<double>
Hash support for double.
template<>
struct bn::hash<long double>
Hash support for long double.
template<>
struct bn::hash<hbe_ptr>
Hash support for hbe_ptr.
template<>
struct bn::hash<istring_base>
Hash support for istring_base.
template<>
struct bn::hash<music_item>
Hash support for music_item.
template<typename Type>
struct bn::hash<optional<Type>>
Hash support for optional.
template<>
struct bn::hash<point>
Hash support for point.
template<>
struct bn::hash<rect>
Hash support for rect.
template<>
struct bn::hash<regular_bg_map_ptr>
Hash support for regular_bg_map_ptr.
template<>
struct bn::hash<regular_bg_ptr>
Hash support for regular_bg_ptr.
template<>
struct bn::hash<regular_bg_tiles_ptr>
Hash support for regular_bg_tiles_ptr.
template<>
struct bn::hash<size>
Hash support for size.
template<>
struct bn::hash<sound_handle>
Hash support for sound_handle.
template<>
struct bn::hash<sound_item>
Hash support for sound_item.
template<>
struct bn::hash<sprite_affine_mat_attributes_hbe_ptr>
Hash support for sprite_affine_mat_attributes_hbe_ptr.
template<>
struct bn::hash<sprite_affine_mat_ptr>
Hash support for sprite_affine_mat_ptr.
template<>
struct bn::hash<sprite_palette_ptr>
Hash support for sprite_palette_ptr.
template<>
struct bn::hash<sprite_ptr>
Hash support for sprite_ptr.
template<>
struct bn::hash<sprite_tiles_ptr>
Hash support for sprite_tiles_ptr.
template<>
struct bn::hash<istring>
Hash support for istring.
template<int MaxSize>
struct bn::hash<string<MaxSize>>
Hash support for string.
template<>
struct bn::hash<string_view>
Hash support for string_view.
template<int Precision>
struct bn::hash<top_left_fixed_rect_t<Precision>>
Hash support for top_left_fixed_rect_t.
template<>
struct bn::hash<top_left_rect>
Hash support for top_left_rect.
template<>
struct bn::hash<type_id_t>
Hash support for type_id_t.
template<typename Type, typename Deleter>
struct bn::hash<unique_ptr<Type, Deleter>>
Hash support for unique_ptr.
template<>
struct bn::hash<window>
Hash support for window.

Functions

template<typename EnumType>
requires(is_enum_v<EnumType>) struct hash< EnumType >
Hash support for enums.
template<typename Type>
void hash_combine(const Type& value, unsigned& result) constexpr
Combines the hash of the given value with another hash.
auto array_hash(const void* ptr, int size) -> unsigned constexpr
Calculates the hash of the given plain data array.
template<typename Type>
auto make_hash(const Type& value) -> unsigned constexpr
Returns the hash of the given value.

Function documentation

template<typename EnumType>
requires(is_enum_v<EnumType>) struct hash< EnumType >

Hash support for enums.

Returns the hash of the given enum.

template<typename Type>
void hash_combine(const Type& value, unsigned& result) constexpr

Combines the hash of the given value with another hash.

Parameters
value result hash is combined with the hash of this value.
result The hash of the given value is combined with this hash, and stored in it.

unsigned array_hash(const void* ptr, int size) constexpr

Calculates the hash of the given plain data array.

Parameters
ptr Start position of the plain data array.
size Size in bytes of the plain data array.

template<typename Type>
unsigned make_hash(const Type& value) constexpr

Returns the hash of the given value.