forked from M-Labs/nac3
42 lines
627 B
C++
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);
|
|
} |