|
|
@@ -316,7 +316,7 @@ public:
|
|
|
: storage{std::move(other.storage)},
|
|
|
ctx{&area},
|
|
|
node{(other.node.resolve != nullptr) ? std::exchange(other.node, internal::meta_type_node{}).resolve(internal::meta_context::from(*ctx)) : std::exchange(other.node, internal::meta_type_node{})},
|
|
|
- vtable{std::exchange(other.vtable, &basic_vtable<void>)} {}
|
|
|
+ vtable{std::exchange(other.vtable, nullptr)} {}
|
|
|
|
|
|
/**
|
|
|
* @brief Copy constructor.
|
|
|
@@ -332,7 +332,7 @@ public:
|
|
|
: storage{std::move(other.storage)},
|
|
|
ctx{other.ctx},
|
|
|
node{std::exchange(other.node, internal::meta_type_node{})},
|
|
|
- vtable{std::exchange(other.vtable, &basic_vtable<void>)} {}
|
|
|
+ vtable{std::exchange(other.vtable, nullptr)} {}
|
|
|
|
|
|
/*! @brief Frees the internal storage, whatever it means. */
|
|
|
~meta_any() {
|
|
|
@@ -368,7 +368,7 @@ public:
|
|
|
storage = std::move(other.storage);
|
|
|
ctx = other.ctx;
|
|
|
node = std::exchange(other.node, internal::meta_type_node{});
|
|
|
- vtable = std::exchange(other.vtable, &basic_vtable<void>);
|
|
|
+ vtable = std::exchange(other.vtable, nullptr);
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -546,7 +546,7 @@ public:
|
|
|
release();
|
|
|
storage.reset();
|
|
|
node = {};
|
|
|
- vtable = &basic_vtable<void>;
|
|
|
+ vtable = nullptr;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -555,14 +555,14 @@ public:
|
|
|
*/
|
|
|
[[nodiscard]] meta_sequence_container as_sequence_container() noexcept {
|
|
|
meta_sequence_container proxy = (storage.policy() == any_policy::cref) ? std::as_const(*this).as_sequence_container() : meta_sequence_container{};
|
|
|
- if(!proxy) { vtable(internal::meta_traits::is_sequence_container, *ctx, storage.data(), &proxy); }
|
|
|
+ if(!proxy && vtable) { vtable(internal::meta_traits::is_sequence_container, *ctx, storage.data(), &proxy); }
|
|
|
return proxy;
|
|
|
}
|
|
|
|
|
|
/*! @copydoc as_sequence_container */
|
|
|
[[nodiscard]] meta_sequence_container as_sequence_container() const noexcept {
|
|
|
meta_sequence_container proxy{};
|
|
|
- vtable(internal::meta_traits::is_sequence_container | internal::meta_traits::is_const, *ctx, storage.data(), &proxy);
|
|
|
+ if(vtable) { vtable(internal::meta_traits::is_sequence_container | internal::meta_traits::is_const, *ctx, storage.data(), &proxy); }
|
|
|
return proxy;
|
|
|
}
|
|
|
|
|
|
@@ -572,14 +572,14 @@ public:
|
|
|
*/
|
|
|
[[nodiscard]] meta_associative_container as_associative_container() noexcept {
|
|
|
meta_associative_container proxy = (storage.policy() == any_policy::cref) ? std::as_const(*this).as_associative_container() : meta_associative_container{};
|
|
|
- if(!proxy) { vtable(internal::meta_traits::is_associative_container, *ctx, storage.data(), &proxy); }
|
|
|
+ if(!proxy && vtable) { vtable(internal::meta_traits::is_associative_container, *ctx, storage.data(), &proxy); }
|
|
|
return proxy;
|
|
|
}
|
|
|
|
|
|
/*! @copydoc as_associative_container */
|
|
|
[[nodiscard]] meta_associative_container as_associative_container() const noexcept {
|
|
|
meta_associative_container proxy{};
|
|
|
- vtable(internal::meta_traits::is_associative_container | internal::meta_traits::is_const, *ctx, storage.data(), &proxy);
|
|
|
+ if(vtable) { vtable(internal::meta_traits::is_associative_container | internal::meta_traits::is_const, *ctx, storage.data(), &proxy); }
|
|
|
return proxy;
|
|
|
}
|
|
|
|
|
|
@@ -590,7 +590,7 @@ public:
|
|
|
*/
|
|
|
[[nodiscard]] meta_any operator*() const noexcept {
|
|
|
meta_any ret{meta_ctx_arg, *ctx};
|
|
|
- vtable(internal::meta_traits::is_pointer_like, *ctx, storage.data(), &ret);
|
|
|
+ if(vtable) { vtable(internal::meta_traits::is_pointer_like, *ctx, storage.data(), &ret); }
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
@@ -642,7 +642,7 @@ private:
|
|
|
any storage{};
|
|
|
const meta_ctx *ctx{&locator<meta_ctx>::value_or()};
|
|
|
internal::meta_type_node node{};
|
|
|
- vtable_type *vtable{&basic_vtable<void>};
|
|
|
+ vtable_type *vtable{};
|
|
|
};
|
|
|
|
|
|
/**
|