userver: userver/storages/postgres/detail/string_hash.hpp Source File
Loading...
Searching...
No Matches
string_hash.hpp
1#pragma once
2
3#include <cstdint>
4#include <string_view>
5
6USERVER_NAMESPACE_BEGIN
7
8namespace storages::postgres::utils {
9
10std::size_t StrHash(const char* str, std::size_t len);
11inline std::size_t StrHash(const std::string_view& str) {
12 return StrHash(str.data(), str.size());
13}
14
15struct StringViewHash {
16 std::size_t operator()(const std::string_view& str) const {
17 return StrHash(str);
18 }
19};
20
21} // namespace storages::postgres::utils
22
23USERVER_NAMESPACE_END