Added is_float_type.

This commit is contained in:
Davis King 2011-09-24 16:38:51 -04:00
parent c0bb7952bf
commit a9ffaf8fa8
1 changed files with 13 additions and 0 deletions

View File

@ -431,6 +431,19 @@ namespace dlib
is_same_type();
};
// ----------------------------------------------------------------------------------------
/*!A is_float_type
This is a template that can be used to determine if a type is one of the built
int floating point types (i.e. float, double, or long double).
!*/
template < typename T > struct is_float_type { const static bool value = false; };
template <> struct is_float_type<float> { const static bool value = true; };
template <> struct is_float_type<double> { const static bool value = true; };
template <> struct is_float_type<long double> { const static bool value = true; };
// ----------------------------------------------------------------------------------------
/*!A is_convertible