forked from M-Labs/nac3
lyken
628965e519
progress details: - organize test suite sources with namespaces - organize ndarray implementations with namespaces - remove extraneous code/comment - add more tests - some renaming - fix pre-existing bugs - ndarray::subscript now throw errors
47 lines
805 B
C++
47 lines
805 B
C++
#pragma once
|
|
|
|
#include <cstdlib>
|
|
#include <cstdio>
|
|
|
|
template <class T>
|
|
void print_value(const T& value) {}
|
|
|
|
template <>
|
|
void print_value(const bool& value) {
|
|
printf("%s", value ? "true" : "false");
|
|
}
|
|
|
|
template <>
|
|
void print_value(const int8_t& value) {
|
|
printf("%d", value);
|
|
}
|
|
|
|
template <>
|
|
void print_value(const int32_t& value) {
|
|
printf("%d", value);
|
|
}
|
|
|
|
template <>
|
|
void print_value(const uint8_t& value) {
|
|
printf("%u", value);
|
|
}
|
|
|
|
template <>
|
|
void print_value(const uint32_t& value) {
|
|
printf("%u", value);
|
|
}
|
|
|
|
template <>
|
|
void print_value(const double& value) {
|
|
printf("%f", value);
|
|
}
|
|
|
|
// template <double>
|
|
// void print_value(const double& value) {
|
|
// printf("%f", value);
|
|
// }
|
|
//
|
|
// template <char *>
|
|
// void print_value(const char*& value) {
|
|
// printf("%f", value);
|
|
// }
|