EnTT 3.13.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
9struct 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
17struct as_cref_t final {
19 template<typename Type>
20 static constexpr bool value = std::is_reference_v<Type>;
22};
23
25struct as_is_t final {
27 template<typename>
28 static constexpr bool value = true;
30};
31
33struct as_void_t final {
35 template<typename>
36 static constexpr bool value = true;
38};
39
45template<typename Type>
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>
55
56} // namespace entt
57
58#endif
EnTT default namespace.
Definition dense_map.hpp:21
constexpr bool is_meta_policy_v
Helper variable template.
Definition policy.hpp:54
Empty class type used to request the as cref policy.
Definition policy.hpp:17
Empty class type used to request the as-is policy.
Definition policy.hpp:25
Empty class type used to request the as ref policy.
Definition policy.hpp:9
Empty class type used to request the as void policy.
Definition policy.hpp:33
Provides the member constant value to true if a type also is a meta policy, false otherwise.
Definition policy.hpp:47