Commit be080797 authored by Davis King's avatar Davis King

Added is_reference_type

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403602
parent 09624611
...@@ -331,7 +331,7 @@ namespace dlib ...@@ -331,7 +331,7 @@ namespace dlib
/*!A is_pointer_type /*!A is_pointer_type
This is a template where is_pointer_type<T>::value == true when T is a pointer This is a template where is_pointer_type<T>::value == true when T is a pointer
type ane false otherwise. type and false otherwise.
!*/ !*/
template < template <
...@@ -361,7 +361,7 @@ namespace dlib ...@@ -361,7 +361,7 @@ namespace dlib
/*!A is_const_type /*!A is_const_type
This is a template where is_const_type<T>::value == true when T is a const This is a template where is_const_type<T>::value == true when T is a const
type ane false otherwise. type and false otherwise.
!*/ !*/
template <typename T> template <typename T>
...@@ -375,6 +375,23 @@ namespace dlib ...@@ -375,6 +375,23 @@ namespace dlib
static const bool value = true; static const bool value = true;
}; };
// ----------------------------------------------------------------------------------------
/*!A is_reference_type
This is a template where is_reference_type<T>::value == true when T is a reference
type and false otherwise.
!*/
template <typename T>
struct is_reference_type
{
static const bool value = false;
};
template <typename T> struct is_reference_type<const T&> { static const bool value = true; };
template <typename T> struct is_reference_type<T&> { static const bool value = true; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
/*!A is_same_type /*!A is_same_type
......
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