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

EnTT 3.15.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
9 struct as_ref_t final {
11 template<typename Type>
12 static constexpr bool value = std::is_reference_v<Type> && !std::is_const_v<std::remove_reference_t<Type>>;
14};
15
17 struct as_cref_t final {
19 template<typename Type>
20 static constexpr bool value = std::is_reference_v<Type>;
22};
23
25 struct as_is_t final {
27 template<typename>
28 static constexpr bool value = true;
30};
31
33 struct as_void_t final {
35 template<typename>
36 static constexpr bool value = true;
38};
39
45template<typename Type>
46 struct is_meta_policy
47 : std::bool_constant<std::is_same_v<Type, as_ref_t> || std::is_same_v<Type, as_cref_t> || std::is_same_v<Type, as_is_t> || std::is_same_v<Type, as_void_t>> {};
48
53template<typename Type>
54 inline constexpr bool is_meta_policy_v = is_meta_policy<Type>::value;
55
56} // namespace entt
57
58#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:54
entt::as_cref_t
Empty class type used to request the as cref policy.
Definition policy.hpp:17
entt::as_is_t
Empty class type used to request the as-is policy.
Definition policy.hpp:25
entt::as_ref_t
Empty class type used to request the as ref policy.
Definition policy.hpp:9
entt::as_void_t
Empty class type used to request the as void policy.
Definition policy.hpp:33
entt::is_meta_policy
Provides the member constant value to true if a type also is a meta policy, false otherwise.
Definition policy.hpp:47