rename uvalue::is_valid to has_value

This commit is contained in:
BlackMATov
2023-02-17 03:05:58 +07:00
parent 58c7a31af5
commit c222a3a6a3
4 changed files with 7 additions and 7 deletions

View File

@@ -2907,7 +2907,7 @@ namespace meta_hpp
&& std::is_constructible_v<Tp, std::initializer_list<U>&, Args...> //
Tp& emplace(std::initializer_list<U> ilist, Args&&... args);
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] bool has_value() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
void reset() noexcept;
@@ -8764,12 +8764,12 @@ namespace meta_hpp
return vtable_t::do_ctor<T>(*this, ilist, std::forward<Args>(args)...);
}
inline bool uvalue::is_valid() const noexcept {
inline bool uvalue::has_value() const noexcept {
return storage_.vtag != 0;
}
inline uvalue::operator bool() const noexcept {
return is_valid();
return has_value();
}
inline void uvalue::reset() noexcept {

View File

@@ -161,7 +161,7 @@ TEST_CASE("meta/meta_utilities/value") {
CHECK(!val);
CHECK_FALSE(val);
CHECK_FALSE(val.is_valid());
CHECK_FALSE(val.has_value());
CHECK(val.get_data() == nullptr);
CHECK(std::as_const(val).get_data() == nullptr);
CHECK(std::as_const(val).get_cdata() == nullptr);

View File

@@ -54,7 +54,7 @@ namespace meta_hpp
&& std::is_constructible_v<Tp, std::initializer_list<U>&, Args...> //
Tp& emplace(std::initializer_list<U> ilist, Args&&... args);
[[nodiscard]] bool is_valid() const noexcept;
[[nodiscard]] bool has_value() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
void reset() noexcept;

View File

@@ -330,12 +330,12 @@ namespace meta_hpp
return vtable_t::do_ctor<T>(*this, ilist, std::forward<Args>(args)...);
}
inline bool uvalue::is_valid() const noexcept {
inline bool uvalue::has_value() const noexcept {
return storage_.vtag != 0;
}
inline uvalue::operator bool() const noexcept {
return is_valid();
return has_value();
}
inline void uvalue::reset() noexcept {