From 7518cf91c2e778293b07e3407d065b5281b72ae1 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 28 Nov 2019 16:39:05 +0100 Subject: [PATCH] crimson/common/errorator.h: simplify the compound safe_then() variant. Signed-off-by: Radoslaw Zarzynski --- src/crimson/common/errorator.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index 17a95403fe6dc..38fb93bd72f79 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -521,17 +521,15 @@ private: // taking ErrorFuncOne and ErrorFuncTwo separately from ErrorFuncTail // to avoid SFINAE template auto safe_then(ValueFunc&& value_func, - ErrorFuncOne&& error_func_one, - ErrorFuncTwo&& error_func_two, + ErrorFuncHead&& error_func_head, ErrorFuncTail&&... error_func_tail) { + static_assert(sizeof...(ErrorFuncTail) > 0); return safe_then( std::forward(value_func), - composer(std::forward(error_func_one), - std::forward(error_func_two), + composer(std::forward(error_func_head), std::forward(error_func_tail)...)); } -- 2.39.5