Photon Common Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
detail.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <string>
5#include <string_view>
6#include <functional>
7
8namespace ph::detail
9{
10
11// References:
12// [1] https://www.cppstories.com/2021/heterogeneous-access-cpp20/
13// [2] https://en.cppreference.com/w/cpp/container/unordered_map/find
15{
16 using is_transparent = void;
17
18 [[nodiscard]]
19 std::size_t operator () (const char* txt) const
20 {
21 return std::hash<std::string_view>{}(txt);
22 }
23
24 [[nodiscard]]
25 std::size_t operator () (std::string_view txt) const
26 {
27 return std::hash<std::string_view>{}(txt);
28 }
29
30 [[nodiscard]]
31 std::size_t operator () (const std::string& txt) const
32 {
33 return std::hash<std::string>{}(txt);
34 }
35};
36
37}// end namespace ph::detail
Implementation detail mainly for internal usages.
Definition assertion.h:9
std::size_t operator()(const char *txt) const
Definition detail.h:19
void is_transparent
Definition detail.h:16