2
3
4
5
6
7
8
11#ifndef _GLSL_STRUCT_HASH_HPP_
12 #define _GLSL_STRUCT_HASH_HPP_
14 #include <glslstruct/config.hpp>
17_GLSL_STRUCT_ERROR(
"This is only available for c++17 and greater!");
20 #include <glslstruct/libs.hpp>
22namespace glslstruct::utils {
25
26
27
28
29 template<
class T> concept hashable = requires {
typename std::hash<T>; };
32
33
34
35
37 static _GLSL_STRUCT_CONSTEXPR17
bool is_hashable_v = hashable<T>;
40
41
42
43
45 struct is_hashable : std::bool_constant<is_hashable_v<T> > {};
48
49
50
51
52 template<
class T,
class =
void>
53 struct is_hashable : std::false_type {};
56
57
58
59
61 struct is_hashable<T, std::void_t<std::hash<T> > > : std::true_type {};
64
65
66
67
#define _GLSL_STRUCT_HAS_CXX20
check if compiler has c++ version greater or equal to c++20 and if user enabled c++20 features using ...
Definition config.hpp:142
#define _GLSL_STRUCT_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:130
#define _GLSL_STRUCT_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:196