JSON RPC
JSON-RPC 2.0 library for C++
wwa::json_rpc::hasher Struct Reference

Custom hasher for std::string_view. More...

#include <dispatcher_p.h>

Public Types

using is_transparent = void
 Indicates that the hasher supports transparent key lookup.
 

Public Member Functions

std::size_t operator() (std::string_view s) const noexcept
 Computes the hash value for a given std::string_view.
 

Detailed Description

Custom hasher for std::string_view.

This struct provides a custom hash function for std::string_view to be used in unordered containers.

Definition at line 26 of file dispatcher_p.h.

Member Typedef Documentation

◆ is_transparent

Indicates that the hasher supports transparent key lookup.

Definition at line 27 of file dispatcher_p.h.

Member Function Documentation

◆ operator()()

std::size_t wwa::json_rpc::hasher::operator() ( std::string_view s) const
inlinenoexcept

Computes the hash value for a given std::string_view.

Parameters
sThe std::string_view to hash.
Returns
The hash value.

Definition at line 35 of file dispatcher_p.h.

36 {
37 const std::hash<std::string_view> h;
38 return h(s);
39 }

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