Is it possible to convert all std::string
items inside a tuple to const char*
?
template<typename... Ts>
std::tuple<Ts...> tup
The problem I facing is I try to print a variadic template to file
fprintf(file, std::get<Idx>(tup)...)
the first item in tup is the format string (const char*
for sure), the rest are print args. The args may contain std::string
. The problem is that fprintf
does not take std::string
. How do I convert all std::string
inside the tuple to const char*
and form another tuple?
The tup
will not go out scope before finish the print.