From 436cdf0a7ecefeb8fc307103c6b194b3b0ae63ec Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 27 Oct 2022 22:36:06 +0100 Subject: [PATCH] Use std::enable_if_t and std::is_signed_v. --- unitTests/test_safe_op.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unitTests/test_safe_op.cpp b/unitTests/test_safe_op.cpp index 438f2691..29284158 100644 --- a/unitTests/test_safe_op.cpp +++ b/unitTests/test_safe_op.cpp @@ -26,19 +26,19 @@ struct AdditionTestValues; * Overload for unsigned types. */ template -struct AdditionTestValues::VALUE>::type> { +struct AdditionTestValues>> { static const size_t case_count = 5; static const T summand[case_count]; static const bool overflow[case_count][case_count]; }; template -const T AdditionTestValues::VALUE>::type>::summand[] = { +const T AdditionTestValues>>::summand[] = { 0, 1, 2, static_cast(std::numeric_limits::max() - 1), std::numeric_limits::max()}; template const bool AdditionTestValues< - T, typename std::enable_if::VALUE>::type>::overflow[case_count][case_count] = { + T, std::enable_if_t>>::overflow[case_count][case_count] = { // 0 {false, false, false, false, false}, // 1 @@ -54,14 +54,14 @@ const bool AdditionTestValues< * Overload for signed integers */ template -struct AdditionTestValues::VALUE>::type> { +struct AdditionTestValues>> { static const size_t case_count = 8; static const T summand[case_count]; static const bool overflow[case_count][case_count]; }; template -const T AdditionTestValues::VALUE>::type>::summand[] = { +const T AdditionTestValues>>::summand[] = { std::numeric_limits::min(), static_cast(std::numeric_limits::min() + 1), -1, @@ -73,7 +73,7 @@ const T AdditionTestValues::VALUE>: template const bool - AdditionTestValues::VALUE>::type>::overflow[case_count][case_count] = { + AdditionTestValues>>::overflow[case_count][case_count] = { // min {true, true, true, false, false, false, false, false}, // min + 1