mirror of https://github.com/davisking/dlib.git
Added is_float_type.
This commit is contained in:
parent
c0bb7952bf
commit
a9ffaf8fa8
13
dlib/algs.h
13
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<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
|
||||
|
|
Loading…
Reference in New Issue