diff --git a/tmva/sofie/test/test_helpers.h b/tmva/sofie/test/test_helpers.h index fd89279257fea..20a121d34ed72 100644 --- a/tmva/sofie/test/test_helpers.h +++ b/tmva/sofie/test/test_helpers.h @@ -70,22 +70,6 @@ runModel(std::string outputTypeName, std::string const &modelName, std::string s outputTypeName = "std::tuple, std::vector>"; } - // Helper: map C++ type -> string used in interpreter - auto type_name = []() { - if constexpr (std::is_same_v) - return "int"; - else if constexpr (std::is_same_v>) - return "std::vector"; - else if constexpr (std::is_same_v>) - return "std::vector"; - else if constexpr (std::is_same_v>) - return "std::vector"; - else if constexpr (std::is_same_v>) - return "std::vector"; - else - static_assert(!sizeof(T), "Input type not supported"); - }; - std::stringstream cmd; if (sessionArgs.empty()) { @@ -104,15 +88,34 @@ runModel(std::string outputTypeName, std::string const &modelName, std::string s } // Emit all inputs to s.infer(...) - bool first = true; - ( - [&] { - if (!first) - cmd << ", "; - first = false; - cmd << toInterpreter(inputs, type_name.template operator()(), true); - }(), - ...); + if constexpr (sizeof...(Ts) > 0) { + + // Helper: map C++ type -> string used in interpreter + auto type_name = []() { + if constexpr (std::is_same_v) + return "int"; + else if constexpr (std::is_same_v>) + return "std::vector"; + else if constexpr (std::is_same_v>) + return "std::vector"; + else if constexpr (std::is_same_v>) + return "std::vector"; + else if constexpr (std::is_same_v>) + return "std::vector"; + else + static_assert(!sizeof(T), "Input type not supported"); + }; + + bool first = true; + ( + [&] { + if (!first) + cmd << ", "; + first = false; + cmd << toInterpreter(inputs, type_name.template operator()(), true); + }(), + ...); + } cmd << R"(); std::swap(output, *)"