mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 11:40:35 +07:00
operator* and operator-> for uresult
This commit is contained in:
@@ -123,10 +123,18 @@ namespace meta_hpp
|
||||
[[nodiscard]] bool has_value() const noexcept;
|
||||
[[nodiscard]] explicit operator bool() const noexcept;
|
||||
|
||||
[[nodiscard]] uvalue& get_value() &;
|
||||
[[nodiscard]] uvalue&& get_value() &&;
|
||||
[[nodiscard]] const uvalue& get_value() const&;
|
||||
[[nodiscard]] const uvalue&& get_value() const&&;
|
||||
[[nodiscard]] uvalue* operator->() noexcept;
|
||||
[[nodiscard]] const uvalue* operator->() const noexcept;
|
||||
|
||||
[[nodiscard]] uvalue& operator*() & noexcept;
|
||||
[[nodiscard]] uvalue&& operator*() && noexcept;
|
||||
[[nodiscard]] const uvalue& operator*() const& noexcept;
|
||||
[[nodiscard]] const uvalue&& operator*() const&& noexcept;
|
||||
|
||||
[[nodiscard]] uvalue& get_value() & noexcept;
|
||||
[[nodiscard]] uvalue&& get_value() && noexcept;
|
||||
[[nodiscard]] const uvalue& get_value() const& noexcept;
|
||||
[[nodiscard]] const uvalue&& get_value() const&& noexcept;
|
||||
|
||||
[[nodiscard]] error_code get_error() const noexcept;
|
||||
|
||||
|
||||
@@ -120,19 +120,44 @@ namespace meta_hpp
|
||||
return has_value();
|
||||
}
|
||||
|
||||
inline uvalue& uresult::get_value() & {
|
||||
inline uvalue* uresult::operator->() noexcept {
|
||||
return std::addressof(value_);
|
||||
}
|
||||
|
||||
inline const uvalue* uresult::operator->() const noexcept {
|
||||
return std::addressof(value_);
|
||||
}
|
||||
|
||||
inline uvalue& uresult::operator*() & noexcept {
|
||||
return value_;
|
||||
}
|
||||
|
||||
inline uvalue&& uresult::get_value() && {
|
||||
inline uvalue&& uresult::operator*() && noexcept {
|
||||
return std::move(value_);
|
||||
}
|
||||
|
||||
inline const uvalue& uresult::get_value() const& {
|
||||
inline const uvalue& uresult::operator*() const& noexcept {
|
||||
return value_;
|
||||
}
|
||||
|
||||
inline const uvalue&& uresult::get_value() const&& {
|
||||
inline const uvalue&& uresult::operator*() const&& noexcept {
|
||||
// NOLINTNEXTLINE(*-move-const-arg)
|
||||
return std::move(value_);
|
||||
}
|
||||
|
||||
inline uvalue& uresult::get_value() & noexcept {
|
||||
return value_;
|
||||
}
|
||||
|
||||
inline uvalue&& uresult::get_value() && noexcept {
|
||||
return std::move(value_);
|
||||
}
|
||||
|
||||
inline const uvalue& uresult::get_value() const& noexcept {
|
||||
return value_;
|
||||
}
|
||||
|
||||
inline const uvalue&& uresult::get_value() const&& noexcept {
|
||||
// NOLINTNEXTLINE(*-move-const-arg)
|
||||
return std::move(value_);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user