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
17struct as_value_t final: private internal::meta_policy {
19 template<typename>
20 static constexpr bool value = true;
22};
23
25struct as_void_t final: private internal::meta_policy {
27 template<typename>
28 static constexpr bool value = true;
30};
31
33struct 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
41struct as_cref_t final: private internal::meta_policy {
43 template<typename Type>
44 static constexpr bool value = std::is_reference_v<Type>;
46};
47
49struct as_is_t final: private internal::meta_policy {
51 template<typename>
52 static constexpr bool value = true;
54};
55
61template<typename Type>
63 : std::bool_constant<std::is_base_of_v<internal::meta_policy, Type>> {};
64
69template<typename Type>
71
72} // namespace entt
73
74#endif
EnTT default namespace.
Definition dense_map.hpp:22
constexpr bool is_meta_policy_v
Helper variable template.
Definition policy.hpp:70
Empty class type used to request the as cref policy.
Definition policy.hpp:41
Empty class type used to request the as auto policy.
Definition policy.hpp:49
Empty class type used to request the as ref policy.
Definition policy.hpp:33
Empty class type used to request the as-is policy.
Definition policy.hpp:17
Empty class type used to request the as void policy.
Definition policy.hpp:25
Provides the member constant value to true if a type also is a meta policy, false otherwise.
Definition policy.hpp:63