#include namespace utils{ void printf(const char* format){ std::cout << format; } template void printf(const char* format, T value, Args ... args){ for ( ; *format != '\0'; format++ ) { if ( *format == '%' ) { std::cout << value; printf(format + 1, args ... ); return; } std::cout << *format; } } template void printf(const std::string& format, T value, Args ... args){ printf(format.c_str(), value, args...); } } int main(){ utils::printf('% world% %\n', "Hello", '!', 2019); }