aboutsummaryrefslogtreecommitdiff
path: root/src/common/typed_address.h
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-07-09 03:47:04 +0200
committercrueter <crueter@eden-emu.dev>2026-07-09 03:47:04 +0200
commit41762940d6bd6350901f12662248b95b91b51e6c (patch)
tree9aa1c2290aaae63076d7662caba7af725c6062a4 /src/common/typed_address.h
parentc2e74a93804f0ba4e7e87a95e8881bbe817aa0a4 (diff)
[common] rework BitField and BitUtil, use concepts whenever possible (#4076)
test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src/common/typed_address.h')
-rw-r--r--src/common/typed_address.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/typed_address.h b/src/common/typed_address.h
index 4df48a99fb..f716accd03 100644
--- a/src/common/typed_address.h
+++ b/src/common/typed_address.h
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -30,8 +33,8 @@ public:
// Arithmetic operators.
template <typename I>
+ requires std::is_integral_v<I>
constexpr inline TypedAddress operator+(I rhs) const {
- static_assert(std::is_integral_v<I>);
return m_address + rhs;
}
@@ -48,8 +51,8 @@ public:
}
template <typename I>
+ requires std::is_integral_v<I>
constexpr inline TypedAddress operator-(I rhs) const {
- static_assert(std::is_integral_v<I>);
return m_address - rhs;
}
@@ -66,15 +69,15 @@ public:
}
template <typename I>
+ requires std::is_integral_v<I>
constexpr inline TypedAddress operator+=(I rhs) {
- static_assert(std::is_integral_v<I>);
m_address += rhs;
return *this;
}
template <typename I>
+ requires std::is_integral_v<I>
constexpr inline TypedAddress operator-=(I rhs) {
- static_assert(std::is_integral_v<I>);
m_address -= rhs;
return *this;
}
@@ -89,8 +92,8 @@ public:
}
template <typename I>
+ requires std::is_integral_v<I>
constexpr inline TypedAddress operator|=(I rhs) {
- static_assert(std::is_integral_v<I>);
m_address |= rhs;
return *this;
}