summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/helpers.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/helpers.h b/lib/helpers.h
index 17c60dc..45be139 100644
--- a/lib/helpers.h
+++ b/lib/helpers.h
@@ -15,13 +15,14 @@ namespace MyGrate {
return (i >> offset) & ((1U << size) - 1U);
}
- template<typename X, typename... P>
- constexpr inline void
- verify(bool expr, P &&... p)
+ template<typename X, typename R, typename... P>
+ constexpr inline auto
+ verify(R expr, P &&... p)
{
if (!expr) {
throw X(std::forward<P>(p)...);
}
+ return expr;
}
template<typename T>