diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-01-17 17:10:16 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-01-17 17:10:16 +0100 |
commit | 5e36ec3b6f3cf5513357e8520230083ff9ecb938 (patch) | |
tree | c2e3cabb3324aa4d3dffc328a00bb7fb100855c5 /Eigen/src/plugins | |
parent | f7852c3d16b7a5636dd8e0603b30034a06c80ac8 (diff) |
Fix regression when passing enums to operator()
Diffstat (limited to 'Eigen/src/plugins')
-rw-r--r-- | Eigen/src/plugins/IndexedViewMethods.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/plugins/IndexedViewMethods.h b/Eigen/src/plugins/IndexedViewMethods.h index 90ade05ed..e6098bfc7 100644 --- a/Eigen/src/plugins/IndexedViewMethods.h +++ b/Eigen/src/plugins/IndexedViewMethods.h @@ -55,7 +55,9 @@ ivcSize(const Indices& indices) const { template<typename RowIndices, typename ColIndices> struct valid_indexed_view_overload { - enum { value = !(internal::is_integral<RowIndices>::value && internal::is_integral<ColIndices>::value) }; + // Here we use is_convertible to Index instead of is_integral in order to treat enums as Index. + // In c++11 we could use is_integral<T> && is_enum<T> if is_convertible appears to be too permissive. + enum { value = !(internal::is_convertible<RowIndices,Index>::value && internal::is_convertible<ColIndices,Index>::value) }; }; public: @@ -81,7 +83,7 @@ operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_IND (derived(), ivcRow(rowIndices), ivcCol(colIndices)); } -// The folowing overload returns a Block<> object +// The following overload returns a Block<> object template<typename RowIndices, typename ColIndices> typename internal::enable_if<valid_indexed_view_overload<RowIndices,ColIndices>::value |