00001 #pragma once 00002 00003 #ifndef TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00004 #define TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00005 00006 00007 namespace YAML 00008 { 00009 template <typename> 00010 struct is_numeric { enum { value = false }; }; 00011 00012 template <> struct is_numeric <char> { enum { value = true }; }; 00013 template <> struct is_numeric <unsigned char> { enum { value = true }; }; 00014 template <> struct is_numeric <int> { enum { value = true }; }; 00015 template <> struct is_numeric <unsigned int> { enum { value = true }; }; 00016 template <> struct is_numeric <long int> { enum { value = true }; }; 00017 template <> struct is_numeric <unsigned long int> { enum { value = true }; }; 00018 template <> struct is_numeric <short int> { enum { value = true }; }; 00019 template <> struct is_numeric <unsigned short int> { enum { value = true }; }; 00020 template <> struct is_numeric <long long> { enum { value = true }; }; 00021 template <> struct is_numeric <unsigned long long> { enum { value = true }; }; 00022 template <> struct is_numeric <float> { enum { value = true }; }; 00023 template <> struct is_numeric <double> { enum { value = true }; }; 00024 template <> struct is_numeric <long double> { enum { value = true }; }; 00025 00026 template <bool, class T = void> 00027 struct enable_if_c { 00028 typedef T type; 00029 }; 00030 00031 template <class T> 00032 struct enable_if_c<false, T> {}; 00033 00034 template <class Cond, class T = void> 00035 struct enable_if : public enable_if_c<Cond::value, T> {}; 00036 00037 template <bool, class T = void> 00038 struct disable_if_c { 00039 typedef T type; 00040 }; 00041 00042 template <class T> 00043 struct disable_if_c<true, T> {}; 00044 00045 template <class Cond, class T = void> 00046 struct disable_if : public disable_if_c<Cond::value, T> {}; 00047 } 00048 00049 #endif // TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00050