Made the is_matrix template a little more robust.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402262
This commit is contained in:
Davis King 2008-05-24 21:38:50 +00:00
parent add9a09a0a
commit 1d2c7a1ca1

View File

@ -26,6 +26,12 @@ namespace dlib
struct is_matrix<matrix_ref<T,NR,NC,mm> > { static const bool value = true; };
template <typename T, long NR, long NC, typename mm>
struct is_matrix<matrix<T,NR,NC,mm> > { static const bool value = true; };
template <typename T>
struct is_matrix<T&> { static const bool value = is_matrix<T>::value; };
template <typename T>
struct is_matrix<const T&> { static const bool value = is_matrix<T>::value; };
template <typename T>
struct is_matrix<const T> { static const bool value = is_matrix<T>::value; };
/*
is_matrix<T>::value == 1 if T is a matrix type else 0
*/