OpenTTD Source: std::hash< StrongType::Typedef< TBaseType, TProperties... > > Struct Template Reference

OpenTTD Source 15.3

Public Member Functions
std::hash< StrongType::Typedef< TBaseType, TProperties... > > Struct Template Reference

Implementation of std::hash for StrongType::Typedef. More...

`#include <strong_typedef_type.hpp>`

## Public Member Functions
std::size_t | operator() (const StrongType::Typedef< TBaseType, TProperties... > &t) const noexcept
| Computes the hash value for a StrongType::Typedef instance.

## Detailed Description

template<typename TBaseType, typename... TProperties>
struct std::hash< StrongType::Typedef< TBaseType, TProperties... > >

Implementation of std::hash for StrongType::Typedef.

This specialization of std::hash allows hashing of StrongType::Typedef instances by leveraging the hash of the base type.

Example Usage: using MyType = StrongType::Typedef<int, struct MyTypeTag>; std::unordered_map<MyType, std::string> my_map;

Template Parameters

  TBaseType | The underlying type of the StrongType::Typedef.
  TProperties | Additional properties for the StrongType::Typedef.

Definition at line 175 of file strong_typedef_type.hpp.

## Member Function Documentation

## ◆ operator()()

template<typename TBaseType , typename... TProperties>

std::size_t std::hash< StrongType::Typedef< TBaseType, TProperties... > >::operator() | ( | const StrongType::Typedef< TBaseType, TProperties... > & | t | ) | const
| inlinenoexcept

Computes the hash value for a StrongType::Typedef instance.

Parameters

  t | The StrongType::Typedef instance to hash.

Returns
  The hash value of the base type of t.

Definition at line 182 of file strong_typedef_type.hpp.

The documentation for this struct was generated from the following file:

- src/core/strong_typedef_type.hpp