瀏覽代碼

fix: .value() should not be noexcept

Sam Jaffe 2 周之前
父節點
當前提交
ec36ba19eb
共有 1 個文件被更改,包括 3 次插入3 次删除
  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*();
     }