traits.h
Go to the documentation of this file.
00001 #ifndef TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
00002 #define TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
00003 
00004 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
00005 #pragma once
00006 #endif
00007 
00008 
00009 namespace YAML_PM
00010 {
00011         template <typename>
00012         struct is_numeric { enum { value = false }; };
00013 
00014         template <> struct is_numeric <char> { enum { value = true }; };
00015         template <> struct is_numeric <unsigned char> { enum { value = true }; };
00016         template <> struct is_numeric <int> { enum { value = true }; };
00017         template <> struct is_numeric <unsigned int> { enum { value = true }; };
00018         template <> struct is_numeric <long int> { enum { value = true }; };
00019         template <> struct is_numeric <unsigned long int> { enum { value = true }; };
00020         template <> struct is_numeric <short int> { enum { value = true }; };
00021         template <> struct is_numeric <unsigned short int> { enum { value = true }; };
00022 #if defined(_MSC_VER) && (_MSC_VER < 1310)
00023         template <> struct is_numeric <__int64> { enum { value = true }; };
00024         template <> struct is_numeric <unsigned __int64> { enum { value = true }; };
00025 #else
00026         template <> struct is_numeric <long long> { enum { value = true }; };
00027         template <> struct is_numeric <unsigned long long> { enum { value = true }; };
00028 #endif
00029         template <> struct is_numeric <float> { enum { value = true }; };
00030         template <> struct is_numeric <double> { enum { value = true }; };
00031         template <> struct is_numeric <long double> { enum { value = true }; };
00032 
00033         template <bool, class T = void>
00034         struct enable_if_c {
00035           typedef T type;
00036         };
00037 
00038         template <class T>
00039         struct enable_if_c<false, T> {};
00040 
00041         template <class Cond, class T = void>
00042         struct enable_if : public enable_if_c<Cond::value, T> {};
00043 
00044         template <bool, class T = void>
00045         struct disable_if_c {
00046           typedef T type;
00047         };
00048 
00049         template <class T>
00050         struct disable_if_c<true, T> {};
00051 
00052         template <class Cond, class T = void>
00053         struct disable_if : public disable_if_c<Cond::value, T> {};
00054 }
00055 
00056 #endif // TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
00057 


libpointmatcher
Author(s):
autogenerated on Mon Sep 14 2015 02:59:06