Browse Source

fix: .value() should not be noexcept

Sam Jaffe 2 tuần trước cách đây
mục cha
commit
ec36ba19eb
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      include/jvalidate/compat/expected.h

+ 3 - 3
include/jvalidate/compat/expected.h

@@ -146,21 +146,21 @@ public:
   constexpr T & operator*() & noexcept { return *std::get_if<0>(&value_); }
   constexpr T && operator*() && noexcept { return std::move(*std::get_if<0>(&value_)); }
 
-  constexpr const T & value() const & noexcept {
+  constexpr const T & value() const & {
     if (JVALIDATE_LIKELY(has_value())) {
       return operator*();
     }
     throw bad_expected_access(error());
   }
 
-  constexpr T & value() & noexcept {
+  constexpr T & value() & {
     if (JVALIDATE_LIKELY(has_value())) {
       return operator*();
     }
     throw bad_expected_access(std::as_const(error()));
   }
 
-  constexpr T && value() && noexcept {
+  constexpr T && value() && {
     if (JVALIDATE_LIKELY(has_value())) {
       return std::move(*this).operator*();
     }