aboutsummaryrefslogtreecommitdiff
path: root/src/common/fixed_point.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-10-18 15:33:47 -0400
committerLioncash <mathew1800@gmail.com>2022-10-18 16:06:50 -0400
commit9cc623426507a783aac7c444d9acefec9d3800d4 (patch)
tree8f063213daf36ab22c4cf09ebc623fde10cb42ad /src/common/fixed_point.h
parent278826ce5ba414cbcd82aae8402f620cdae81660 (diff)
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 'src/common/fixed_point.h')
-rw-r--r--src/common/fixed_point.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h
index ad0d71e502..5aafa273b0 100644
--- a/src/common/fixed_point.h
+++ b/src/common/fixed_point.h
@@ -268,9 +268,12 @@ public:
public: // constructors
FixedPoint() = default;
- FixedPoint(const FixedPoint&) = default;
- FixedPoint(FixedPoint&&) noexcept = default;
- FixedPoint& operator=(const FixedPoint&) = default;
+
+ constexpr FixedPoint(const FixedPoint&) = default;
+ constexpr FixedPoint& operator=(const FixedPoint&) = default;
+
+ constexpr FixedPoint(FixedPoint&&) noexcept = default;
+ constexpr FixedPoint& operator=(FixedPoint&&) noexcept = default;
template <IsArithmetic Number>
constexpr FixedPoint(Number n) : data_(static_cast<base_type>(n * one)) {}