dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Utils::TransparentHash Struct Reference

Transparent hash functor for string-like lookups. More...

#include <dfx-utilities/StringMap.hpp>

Public Types

using is_transparent = void
 Marker enabling heterogeneous lookup in standard associative containers.

Public Member Functions

std::size_t operator() (std::string_view str) const noexcept
 Hash a string view.

Detailed Description

Transparent hash functor for string-like lookups.

Intended for std::unordered_map with std::string keys, enabling lookups with std::string_view (and other compatible types) by advertising is_transparent.

Note
The container key type is still std::string. This only affects which argument types can be used for lookup operations (find/contains/etc.).

Member Typedef Documentation

◆ is_transparent

Marker enabling heterogeneous lookup in standard associative containers.

Member Function Documentation

◆ operator()()

std::size_t dfx::Utils::TransparentHash::operator() ( std::string_view str) const
inlinenoexcept

Hash a string view.

Parameters
strThe string view to hash.
Returns
The hash value.

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