#include <iostream>
#include <string>
#include <typeinfo>
typedef char const *pchar;
template<typename T> struct TypeName {
static std::string Get() { return "unknown"; }
};
template<> struct TypeName<int> {
static std::string Get() { return "int"; }
};
template<> struct TypeName<double> {
static std::string Get() { return "double"; }
};
template<> struct TypeName<std::string> {
static std::string Get() { return "string"; }
};
template<> struct TypeName<char*> {
static std::string Get() { return "char*"; }
};
template<std::size_t N> struct TypeName<char[N]> {
static std::string Get() { return "char[N]"; }
};
template<std::size_t N> struct TypeName<const char[N]> {
static std::string Get() { return "const char[N]"; }
};
void myprint()
{
}
template <typename T, typename... Args>
void myprint(const T& value, const Args&... args)
{
std::cout << TypeName<T>::Get() << ": " << value << std::endl;
myprint(args...);
}
int main()
{
char *s = "adsf";
std::string some_str = "some string";
myprint(5, 4.0, "asdf", 1, s, some_str);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dHlwZWluZm8+CnR5cGVkZWYgY2hhciBjb25zdCAqcGNoYXI7CnRlbXBsYXRlPHR5cGVuYW1lIFQ+IHN0cnVjdCBUeXBlTmFtZSB7CiAgICBzdGF0aWMgc3RkOjpzdHJpbmcgR2V0KCkgeyByZXR1cm4gInVua25vd24iOyB9Cn07CnRlbXBsYXRlPD4gc3RydWN0IFR5cGVOYW1lPGludD4gewogICAgc3RhdGljIHN0ZDo6c3RyaW5nIEdldCgpIHsgcmV0dXJuICJpbnQiOyB9Cn07CnRlbXBsYXRlPD4gc3RydWN0IFR5cGVOYW1lPGRvdWJsZT4gewogICAgc3RhdGljIHN0ZDo6c3RyaW5nIEdldCgpIHsgcmV0dXJuICJkb3VibGUiOyB9ICAgCn07CnRlbXBsYXRlPD4gc3RydWN0IFR5cGVOYW1lPHN0ZDo6c3RyaW5nPiB7CiAgICBzdGF0aWMgc3RkOjpzdHJpbmcgR2V0KCkgeyByZXR1cm4gInN0cmluZyI7IH0gICAKfTsKCnRlbXBsYXRlPD4gc3RydWN0I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