remove uvalue::can_get_as

This commit is contained in:
BlackMATov
2022-11-06 18:25:06 +07:00
parent a630d89e96
commit 291e165ca4
5 changed files with 23 additions and 134 deletions

View File

@@ -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);

View File

@@ -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