forked from M-Labs/nac3
1
0
Fork 0
nac3/nac3core/irrt/test/print.hpp

42 lines
627 B
C++

#pragma once
#include <cstdlib>
#include <cstdio>
template <class T>
void print_value(T value);
template <>
void print_value(char value) {
printf("'%c' (ord=%d)", value, value);
}
template <>
void print_value(int8_t value) {
printf("%d", value);
}
template <>
void print_value(int32_t value) {
printf("%d", value);
}
template <>
void print_value(uint8_t value) {
printf("%u", value);
}
template <>
void print_value(uint32_t value) {
printf("%u", value);
}
template <>
void print_value(double value) {
printf("%f", value);
}
template <>
void print_value(char* value) {
printf("%s", value);
}