mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 19:41:29 +07:00
return an empty type for empty uvalues
This commit is contained in:
@@ -76,7 +76,7 @@ namespace meta_hpp
|
||||
void reset();
|
||||
void swap(uvalue& other) noexcept;
|
||||
|
||||
[[nodiscard]] const any_type& get_type() const noexcept;
|
||||
[[nodiscard]] any_type get_type() const noexcept;
|
||||
|
||||
[[nodiscard]] void* get_data() noexcept;
|
||||
[[nodiscard]] const void* get_data() const noexcept;
|
||||
|
||||
@@ -345,10 +345,9 @@ namespace meta_hpp
|
||||
vtable_t::do_swap(*this, other);
|
||||
}
|
||||
|
||||
inline const any_type& uvalue::get_type() const noexcept {
|
||||
static any_type void_type = resolve_type<void>();
|
||||
inline any_type uvalue::get_type() const noexcept {
|
||||
auto&& [tag, vtable] = vtable_t::unpack_vtag(*this);
|
||||
return tag == storage_e::nothing ? void_type : vtable->type;
|
||||
return tag == storage_e::nothing ? any_type{} : vtable->type;
|
||||
}
|
||||
|
||||
inline void* uvalue::get_data() noexcept {
|
||||
|
||||
Reference in New Issue
Block a user