mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 14:09:02 +07:00
remove uvalue::can_get_as
This commit is contained in:
@@ -76,9 +76,6 @@ namespace meta_hpp
|
||||
[[nodiscard]] auto try_get_as() const noexcept
|
||||
-> std::conditional_t<detail::pointer_kind<T>, T, const T*>;
|
||||
|
||||
template < typename T >
|
||||
[[nodiscard]] bool can_get_as() const noexcept;
|
||||
|
||||
friend bool operator<(const uvalue& l, const uvalue& r);
|
||||
friend bool operator==(const uvalue& l, const uvalue& r);
|
||||
friend std::istream& operator>>(std::istream& is, uvalue& v);
|
||||
|
||||
@@ -489,23 +489,6 @@ namespace meta_hpp
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
bool uvalue::can_get_as() const noexcept {
|
||||
static_assert(std::is_same_v<T, std::decay_t<T>>);
|
||||
|
||||
if constexpr ( detail::pointer_kind<T> ) {
|
||||
if ( T ptr = try_get_as<T>(); ptr || get_type().is_nullptr() ) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ( const T* ptr = try_get_as<T>() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
namespace meta_hpp
|
||||
|
||||
Reference in New Issue
Block a user