From a9ffaf8fa84c78980788c57ab58f4849d3585f35 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 24 Sep 2011 16:38:51 -0400 Subject: [PATCH] Added is_float_type. --- dlib/algs.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlib/algs.h b/dlib/algs.h index 4a5866d7f..0a4200297 100644 --- a/dlib/algs.h +++ b/dlib/algs.h @@ -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 { const static bool value = true; }; + template <> struct is_float_type { const static bool value = true; }; + template <> struct is_float_type { const static bool value = true; }; + // ---------------------------------------------------------------------------------------- /*!A is_convertible