aboutsummaryrefslogtreecommitdiffstats
path: root/funreg.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'funreg.hpp')
-rw-r--r--funreg.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/funreg.hpp b/funreg.hpp
index 9dc5449..db0bb37 100644
--- a/funreg.hpp
+++ b/funreg.hpp
@@ -192,9 +192,9 @@ struct Register {
// bit-mask created by merging all provided bit-masks.
// If no masks are given, a mask selecting all bits is used.
template<typename... Masks>
- static void apply(auto fn) {
+ static constexpr void apply(auto fn) {
if constexpr (sizeof...(Masks) > 0) {
- auto mask = mergeMasks<Masks...>();
+ constexpr auto mask = mergeMasks<Masks...>();
if constexpr (mask)
write(fn(read(), mask));
} else {
@@ -205,7 +205,7 @@ struct Register {
// Takes a list of bit-masks, and returns a merged mask of those which are
// meant for this register.
template<typename... Masks>
- static auto mergeMasks() {
+ static constexpr auto mergeMasks() {
if constexpr (sizeof...(Masks) > 0) {
if constexpr ((isThis<typename Masks::reg> | ...)) {
auto mask =