mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #1752: make is_convertible equivalent to the std c++11 equivalent and fallback to std::is_convertible when c++11 is enabled.
This commit is contained in:
@@ -174,6 +174,11 @@ template<typename T> struct add_const_on_value_type<T*> { typedef T const
|
||||
template<typename T> struct add_const_on_value_type<T* const> { typedef T const* const type; };
|
||||
template<typename T> struct add_const_on_value_type<T const* const> { typedef T const* const type; };
|
||||
|
||||
#if EIGEN_HAS_CXX11
|
||||
|
||||
using std::is_convertible;
|
||||
|
||||
#else
|
||||
|
||||
template<typename From, typename To>
|
||||
struct is_convertible_impl
|
||||
@@ -211,6 +216,14 @@ struct is_convertible
|
||||
enum { value = is_convertible_impl<From,To>::value };
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct is_convertible<T,T&> { enum { value = false }; };
|
||||
|
||||
template<typename T>
|
||||
struct is_convertible<const T,const T&> { enum { value = true }; };
|
||||
|
||||
#endif
|
||||
|
||||
/** \internal Allows to enable/disable an overload
|
||||
* according to a compile time condition.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user