Commit 4ecdd03b authored by Davis King's avatar Davis King

Added an is_pair template for telling if a type is a std::pair object.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404162
parent 975abaf9
......@@ -72,6 +72,19 @@ namespace dlib
!*/
};
// ----------------------------------------------------------------------------------------
template <typename T>
struct is_pair : public default_is_kind_value
{
/*!
- if (T is a std::pair object) then
- is_std_vector<T>::value == true
- else
- is_std_vector<T>::value == false
!*/
};
// ----------------------------------------------------------------------------------------
template <typename T>
......@@ -97,6 +110,11 @@ namespace dlib
template <typename T> struct is_std_vector<const T&>{ const static bool value = is_std_vector<T>::value; };
template <typename T> struct is_std_vector<const T> { const static bool value = is_std_vector<T>::value; };
// ----------------------------------------------------------------------------------------
template <typename T, typename U>
struct is_pair<std::pair<T,U> > { const static bool value = true; };
// ----------------------------------------------------------------------------------------
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment