11 template <
typename T>
struct min {};
12 template <>
struct min<char> {
static const char value = CHAR_MIN; };
13 template <>
struct min<short> {
static const short value = SHRT_MIN; };
14 template <>
struct min<int> {
static const int value = INT_MIN; };
15 template <>
struct min<long> {
static const long value = LONG_MIN; };
16 template <>
struct min<unsigned char> {
static const unsigned char value = 0; };
17 template <>
struct min<unsigned short> {
static const unsigned short value = 0; };
18 template <>
struct min<unsigned int> {
static const unsigned int value = 0; };
19 template <>
struct min<unsigned long> {
static const unsigned long value = 0; };
24 template <>
struct min_fct<float> {
static float get_value() {
return -FLT_MAX; } };
25 template <>
struct min_fct<double> {
static double get_value() {
return -DBL_MAX; } };
the min_fct traits provides a static function returning the minimal value of a type.
the min traits defines for each type in the static const member value, what the minimum value is.