OpenTTD Source: StringHash Struct Reference

OpenTTD Source 15.3

Public Types | Public Member Functions
StringHash Struct Reference

Helper to provide transparent hashing for string types in e.g. More...

`#include <string_type.h>`

## Public Types
using | hash_type = std::hash< std::string_view >
using | is_transparent = void

## Public Member Functions
std::size_t | operator() (std::string_view str) const
std::size_t | operator() (const std::string &str) const

## Detailed Description

Helper to provide transparent hashing for string types in e.g.

std::unordered_map.

Definition at line 63 of file string_type.h.

## Member Typedef Documentation

## ◆ hash_type

using StringHash::hash_type = std::hash<std::string_view>

Definition at line 64 of file string_type.h.

## ◆ is_transparent

using StringHash::is_transparent = void

Definition at line 65 of file string_type.h.

## Member Function Documentation

## ◆ operator()() [1/2]

std::size_t StringHash::operator() | ( | const std::string & | str | ) | const
| inline

Definition at line 68 of file string_type.h.

## ◆ operator()() [2/2]

std::size_t StringHash::operator() | ( | std::string_view | str | ) | const
| inline

Definition at line 67 of file string_type.h.

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

- src/string_type.h