diff options
| author | 2022-10-18 15:33:47 -0400 | |
|---|---|---|
| committer | 2022-10-18 16:06:50 -0400 | |
| commit | b6119a55f9bbc306593afccc0820165d74c2fadc (patch) | |
| tree | 8f063213daf36ab22c4cf09ebc623fde10cb42ad | |
| parent | fixed_point: Mark std::swap and move constructor as noexcept (diff) | |
| download | yuzu-b6119a55f9bbc306593afccc0820165d74c2fadc.tar.gz yuzu-b6119a55f9bbc306593afccc0820165d74c2fadc.tar.xz yuzu-b6119a55f9bbc306593afccc0820165d74c2fadc.zip | |
fixed_point: Mark copy/move assignment operators and constructors as constexpr
Given these are just moving a raw value around, these can sensibly be
made constexpr to make the interface more useful.
Diffstat (limited to '')
| -rw-r--r-- | src/common/fixed_point.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h index ad0d71e50..5aafa273b 100644 --- a/src/common/fixed_point.h +++ b/src/common/fixed_point.h | |||
| @@ -268,9 +268,12 @@ public: | |||
| 268 | 268 | ||
| 269 | public: // constructors | 269 | public: // constructors |
| 270 | FixedPoint() = default; | 270 | FixedPoint() = default; |
| 271 | FixedPoint(const FixedPoint&) = default; | 271 | |
| 272 | FixedPoint(FixedPoint&&) noexcept = default; | 272 | constexpr FixedPoint(const FixedPoint&) = default; |
| 273 | FixedPoint& operator=(const FixedPoint&) = default; | 273 | constexpr FixedPoint& operator=(const FixedPoint&) = default; |
| 274 | |||
| 275 | constexpr FixedPoint(FixedPoint&&) noexcept = default; | ||
| 276 | constexpr FixedPoint& operator=(FixedPoint&&) noexcept = default; | ||
| 274 | 277 | ||
| 275 | template <IsArithmetic Number> | 278 | template <IsArithmetic Number> |
| 276 | constexpr FixedPoint(Number n) : data_(static_cast<base_type>(n * one)) {} | 279 | constexpr FixedPoint(Number n) : data_(static_cast<base_type>(n * one)) {} |