|
|
@@ -291,7 +291,7 @@ public:
|
|
|
* @return False if the wrapper is empty, true otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
|
|
|
- return !(vtable(operation::ADDR, *this, nullptr) == nullptr);
|
|
|
+ return descriptor != type_id<void>();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -393,7 +393,7 @@ Type any_cast(basic_any<Len, Align> &&data) ENTT_NOEXCEPT {
|
|
|
/*! @copydoc any_cast */
|
|
|
template<typename Type, std::size_t Len, std::size_t Align>
|
|
|
const Type * any_cast(const basic_any<Len, Align> *data) ENTT_NOEXCEPT {
|
|
|
- if(data->type().hash() == type_hash<std::remove_const_t<std::remove_reference_t<Type>>>::value()) {
|
|
|
+ if(data->type() == type_id<std::remove_const_t<std::remove_reference_t<Type>>>()) {
|
|
|
return static_cast<const Type *>(data->data());
|
|
|
}
|
|
|
|
|
|
@@ -404,7 +404,7 @@ const Type * any_cast(const basic_any<Len, Align> *data) ENTT_NOEXCEPT {
|
|
|
/*! @copydoc any_cast */
|
|
|
template<typename Type, std::size_t Len, std::size_t Align>
|
|
|
Type * any_cast(basic_any<Len, Align> *data) ENTT_NOEXCEPT {
|
|
|
- if(data->type().hash() == type_hash<std::remove_const_t<std::remove_reference_t<Type>>>::value()) {
|
|
|
+ if(data->type() == type_id<std::remove_const_t<std::remove_reference_t<Type>>>()) {
|
|
|
// last attempt to make wrappers for const references return their values
|
|
|
return static_cast<Type *>(static_cast<constness_as_t<basic_any<Len, Align>, Type> *>(data)->data());
|
|
|
}
|