74 lines
1.1 KiB
C++
74 lines
1.1 KiB
C++
|
|
#include <print.hpp>
|
|
|
|
template <> void print<bool>(const bool b)
|
|
{
|
|
printf("%s", b ? "true" : "false");
|
|
}
|
|
|
|
template <> void print<char*>(char* x)
|
|
{
|
|
printf("%s", x);
|
|
}
|
|
|
|
template <> void print<const char*>(const char* x)
|
|
{
|
|
printf("%s", x);
|
|
}
|
|
|
|
template <> void print<char>(const char x)
|
|
{
|
|
printf("%c", x);
|
|
}
|
|
|
|
template <> void print<signed char>(const signed char x)
|
|
{
|
|
printf("%hhi", x);
|
|
}
|
|
|
|
template <> void print<unsigned char>(const unsigned char x)
|
|
{
|
|
printf("%hhuU", x);
|
|
}
|
|
|
|
template <> void print<signed short>(const signed short x)
|
|
{
|
|
printf("%hi", x);
|
|
}
|
|
|
|
template <> void print<unsigned short>(const unsigned short x)
|
|
{
|
|
printf("%huU", x);
|
|
}
|
|
|
|
template <> void print<signed int>(const signed int x)
|
|
{
|
|
printf("%i", x);
|
|
}
|
|
|
|
template <> void print<unsigned int>(const unsigned int x)
|
|
{
|
|
printf("%uU", x);
|
|
}
|
|
|
|
template <> void print<signed long>(const signed long x)
|
|
{
|
|
printf("%liL", x);
|
|
}
|
|
|
|
template <> void print<unsigned long>(const unsigned long x)
|
|
{
|
|
printf("%luUL", x);
|
|
}
|
|
|
|
template <> void print<float>(const float x)
|
|
{
|
|
printf("%gf", x);
|
|
}
|
|
|
|
template <> void print<double>(const double x)
|
|
{
|
|
printf("%lf", x);
|
|
}
|
|
|
|
|