Why is there a difference between templated recursive calls and fold expressions with type cast or promotion?
Advertisements #include <array> #include <type_traits> #include <iostream> template<class… Types> class Test { public: Test() : format_({ [&] { if constexpr(std::is_same_v<Types, int64_t>) { return "%ld "; } else if constexpr(std::is_same_v<Types, int32_t>) { return "%d "; } else if constexpr(std::is_same_v<Types, double>) { return "%f "; } }() … }) {} template<typename T, typename … Args> void print_recursive(T… Read More Why is there a difference between templated recursive calls and fold expressions with type cast or promotion?