Kaynağa Gözat

fixed_point: Mark std::swap and move constructor as noexcept

These shouldn't throw and can influence how some standard algorithms
will work.
Lioncash 3 yıl önce
ebeveyn
işleme
0cfd90004b
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      src/common/fixed_point.h

+ 2 - 2
src/common/fixed_point.h

@@ -269,7 +269,7 @@ public:
 public: // constructors
     FixedPoint() = default;
     FixedPoint(const FixedPoint&) = default;
-    FixedPoint(FixedPoint&&) = default;
+    FixedPoint(FixedPoint&&) noexcept = default;
     FixedPoint& operator=(const FixedPoint&) = default;
 
     template <IsArithmetic Number>
@@ -454,7 +454,7 @@ public: // conversion to basic types
     }
 
 public:
-    constexpr void swap(FixedPoint& rhs) {
+    constexpr void swap(FixedPoint& rhs) noexcept {
         using std::swap;
         swap(data_, rhs.data_);
     }