stl: std::is_base_of_v

This commit is contained in:
skypjack
2026-04-15 14:30:57 +02:00
parent d700f800aa
commit fee356c7f9
5 changed files with 14 additions and 13 deletions

View File

@@ -65,7 +65,7 @@ class basic_sigh_mixin final: public Type {
using sigh_type = sigh<void(owner_type &, const typename underlying_type::entity_type), typename underlying_type::allocator_type>;
using underlying_iterator = underlying_type::base_type::basic_iterator;
static_assert(std::is_base_of_v<basic_registry_type, owner_type>, "Invalid registry type");
static_assert(stl::is_base_of_v<basic_registry_type, owner_type>, "Invalid registry type");
[[nodiscard]] auto &owner_or_assert() const noexcept {
ENTT_ASSERT(owner != nullptr, "Invalid pointer to registry");
@@ -397,7 +397,7 @@ class basic_reactive_mixin final: public Type {
using basic_registry_type = basic_registry<typename owner_type::entity_type, typename owner_type::allocator_type>;
using container_type = stl::vector<connection, typename alloc_traits::template rebind_alloc<connection>>;
static_assert(std::is_base_of_v<basic_registry_type, owner_type>, "Invalid registry type");
static_assert(stl::is_base_of_v<basic_registry_type, owner_type>, "Invalid registry type");
[[nodiscard]] auto &owner_or_assert() const noexcept {
ENTT_ASSERT(owner != nullptr, "Invalid pointer to registry");

View File

@@ -60,7 +60,7 @@ struct as_is_t final: private internal::meta_policy {
*/
template<typename Type>
struct is_meta_policy
: stl::bool_constant<std::is_base_of_v<internal::meta_policy, Type>> {};
: stl::bool_constant<stl::is_base_of_v<internal::meta_policy, Type>> {};
/**
* @brief Helper variable template.

View File

@@ -48,8 +48,8 @@ template<typename Type, typename Ret, typename Class, typename... Args>
struct meta_function_descriptor<Type, Ret (Class::*)(Args...) const>
: meta_function_descriptor_traits<
Ret,
stl::conditional_t<std::is_base_of_v<Class, Type>, type_list<Args...>, type_list<const Class &, Args...>>,
!std::is_base_of_v<Class, Type>,
stl::conditional_t<stl::is_base_of_v<Class, Type>, type_list<Args...>, type_list<const Class &, Args...>>,
!stl::is_base_of_v<Class, Type>,
true> {};
/**
@@ -63,8 +63,8 @@ template<typename Type, typename Ret, typename Class, typename... Args>
struct meta_function_descriptor<Type, Ret (Class::*)(Args...)>
: meta_function_descriptor_traits<
Ret,
stl::conditional_t<std::is_base_of_v<Class, Type>, type_list<Args...>, type_list<Class &, Args...>>,
!std::is_base_of_v<Class, Type>,
stl::conditional_t<stl::is_base_of_v<Class, Type>, type_list<Args...>, type_list<Class &, Args...>>,
!stl::is_base_of_v<Class, Type>,
false> {};
/**
@@ -77,8 +77,8 @@ template<typename Type, typename Ret, typename Class>
struct meta_function_descriptor<Type, Ret Class::*>
: meta_function_descriptor_traits<
Ret &,
stl::conditional_t<std::is_base_of_v<Class, Type>, type_list<>, type_list<Class &>>,
!std::is_base_of_v<Class, Type>,
stl::conditional_t<stl::is_base_of_v<Class, Type>, type_list<>, type_list<Class &>>,
!stl::is_base_of_v<Class, Type>,
false> {};
/**
@@ -93,11 +93,11 @@ struct meta_function_descriptor<Type, Ret (*)(MaybeType, Args...)>
: meta_function_descriptor_traits<
Ret,
stl::conditional_t<
stl::is_same_v<stl::remove_cvref_t<MaybeType>, Type> || std::is_base_of_v<stl::remove_cvref_t<MaybeType>, Type>,
stl::is_same_v<stl::remove_cvref_t<MaybeType>, Type> || stl::is_base_of_v<stl::remove_cvref_t<MaybeType>, Type>,
type_list<Args...>,
type_list<MaybeType, Args...>>,
!(stl::is_same_v<stl::remove_cvref_t<MaybeType>, Type> || std::is_base_of_v<stl::remove_cvref_t<MaybeType>, Type>),
stl::is_const_v<stl::remove_reference_t<MaybeType>> && (stl::is_same_v<stl::remove_cvref_t<MaybeType>, Type> || std::is_base_of_v<stl::remove_cvref_t<MaybeType>, Type>)> {};
!(stl::is_same_v<stl::remove_cvref_t<MaybeType>, Type> || stl::is_base_of_v<stl::remove_cvref_t<MaybeType>, Type>),
stl::is_const_v<stl::remove_reference_t<MaybeType>> && (stl::is_same_v<stl::remove_cvref_t<MaybeType>, Type> || stl::is_base_of_v<stl::remove_cvref_t<MaybeType>, Type>)> {};
/**
* @brief Meta function descriptor.

View File

@@ -80,7 +80,7 @@ public:
/*! @brief Default destructor. */
virtual ~emitter() {
static_assert(std::is_base_of_v<emitter<Derived, Allocator>, Derived>, "Invalid emitter type");
static_assert(stl::is_base_of_v<emitter<Derived, Allocator>, Derived>, "Invalid emitter type");
}
/**

View File

@@ -17,6 +17,7 @@ using std::invoke_result_t;
using std::is_aggregate_v;
using std::is_arithmetic_v;
using std::is_array_v;
using std::is_base_of_v;
using std::is_class_v;
using std::is_const_v;
using std::is_constructible_v;