EnTT: src/entt/meta/policy.hpp Source File

EnTT 3.16.0

Loading...
Searching...
No Matches
policy.hpp
1#ifndef ENTT_META_POLICY_HPP
2#define ENTT_META_POLICY_HPP
3
4#include <type_traits>
5
6namespace entt {
7
9namespace internal {
10
11struct meta_policy {};
12
13} // namespace internal
15
17 struct as_value_t final: private internal::meta_policy {
19 template<typename>
20 static constexpr bool value = true;
22};
23
25 struct as_void_t final: private internal::meta_policy {
27 template<typename>
28 static constexpr bool value = true;
30};
31
33 struct as_ref_t final: private internal::meta_policy {
35 template<typename Type>
36 static constexpr bool value = std::is_reference_v<Type> && !std::is_const_v<std::remove_reference_t<Type>>;
38};
39
41 struct as_cref_t final: private internal::meta_policy {
43 template<typename Type>
44 static constexpr bool value = std::is_reference_v<Type>;
46};
47
49 struct as_is_t final: private internal::meta_policy {
51 template<typename>
52 static constexpr bool value = true;
54};
55
61template<typename Type>
62 struct is_meta_policy
63 : std::bool_constant<std::is_base_of_v<internal::meta_policy, Type>> {};
64
69template<typename Type>
70 inline constexpr bool is_meta_policy_v = is_meta_policy<Type>::value;
71
72} // namespace entt
73
74#endif
entt
EnTT default namespace.
Definition dense_map.hpp:22
entt::is_meta_policy_v
constexpr bool is_meta_policy_v
Helper variable template.
Definition policy.hpp:70
entt::as_cref_t
Empty class type used to request the as cref policy.
Definition policy.hpp:41
entt::as_is_t
Empty class type used to request the as auto policy.
Definition policy.hpp:49
entt::as_ref_t
Empty class type used to request the as ref policy.
Definition policy.hpp:33
entt::as_value_t
Empty class type used to request the as-is policy.
Definition policy.hpp:17
entt::as_void_t
Empty class type used to request the as void policy.
Definition policy.hpp:25
entt::is_meta_policy
Provides the member constant value to true if a type also is a meta policy, false otherwise.
Definition policy.hpp:63