From 14607b48d21ec9671c848ee4ae567d5fa9128a2c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 12 Jun 2021 20:19:22 +0100 Subject: Have verify return its expression, might be useful --- lib/helpers.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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 - constexpr inline void - verify(bool expr, P &&... p) + template + constexpr inline auto + verify(R expr, P &&... p) { if (!expr) { throw X(std::forward

(p)...); } + return expr; } template -- cgit v1.2.3