From aa7ec98c0f6e74994728a15635801161d25880e7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 26 May 2021 14:31:57 +0200 Subject: [PATCH] eclproblem: use if constexpr for enableApiTracking --- ebos/eclproblem.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index fe7f17665..fcdcb47f9 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -2296,10 +2296,12 @@ private: // Only rank 0 has the deck and hence can do the checks! const auto& deck = this->simulator().vanguard().deck(); - if (enableApiTracking) + if constexpr (enableApiTracking) throw std::logic_error("API tracking is not yet implemented but requested at compile time."); - if (!enableApiTracking && deck.hasKeyword("API")) - throw std::logic_error("The simulator is build with API tracking disabled, but API tracking is requested by the deck."); + else { + if (deck.hasKeyword("API")) + throw std::logic_error("The simulator is build with API tracking disabled, but API tracking is requested by the deck."); + } if constexpr (enableSolvent) { if (!deck.hasKeyword("SOLVENT"))