mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Fix ambiguous instanciation using clean class-level SFINAE in product_evaluator
This commit is contained in:
parent
6fc5438205
commit
a5a7b68b76
@ -100,8 +100,8 @@ struct evaluator_traits<Product<Lhs, Rhs, AliasFreeProduct> >
|
|||||||
// This is the default evaluator implementation for products:
|
// This is the default evaluator implementation for products:
|
||||||
// It creates a temporary and call generic_product_impl
|
// It creates a temporary and call generic_product_impl
|
||||||
template<typename Lhs, typename Rhs, int Options, int ProductTag, typename LhsShape, typename RhsShape>
|
template<typename Lhs, typename Rhs, int Options, int ProductTag, typename LhsShape, typename RhsShape>
|
||||||
struct product_evaluator<Product<Lhs, Rhs, Options>, ProductTag, LhsShape, RhsShape, typename traits<Lhs>::Scalar,
|
struct product_evaluator<Product<Lhs, Rhs, Options>, ProductTag, LhsShape, RhsShape, typename traits<Lhs>::Scalar, typename traits<Rhs>::Scalar,
|
||||||
typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct),typename traits<Rhs>::Scalar>::type>
|
EnableIf<(Options==DefaultProduct || Options==AliasFreeProduct)> >
|
||||||
: public evaluator<typename Product<Lhs, Rhs, Options>::PlainObject>::type
|
: public evaluator<typename Product<Lhs, Rhs, Options>::PlainObject>::type
|
||||||
{
|
{
|
||||||
typedef Product<Lhs, Rhs, Options> XprType;
|
typedef Product<Lhs, Rhs, Options> XprType;
|
||||||
|
@ -147,6 +147,9 @@ template<typename _Scalar, int Rows=Dynamic, int Cols=Dynamic, int Supers=Dynami
|
|||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template<typename Lhs, typename Rhs> struct product_type;
|
template<typename Lhs, typename Rhs> struct product_type;
|
||||||
|
|
||||||
|
template<bool> struct EnableIf;
|
||||||
|
|
||||||
/** \internal
|
/** \internal
|
||||||
* \class product_evaluator
|
* \class product_evaluator
|
||||||
* Products need their own evaluator with more template arguments allowing for
|
* Products need their own evaluator with more template arguments allowing for
|
||||||
@ -157,7 +160,8 @@ template< typename T,
|
|||||||
typename LhsShape = typename evaluator_traits<typename T::Lhs>::Shape,
|
typename LhsShape = typename evaluator_traits<typename T::Lhs>::Shape,
|
||||||
typename RhsShape = typename evaluator_traits<typename T::Rhs>::Shape,
|
typename RhsShape = typename evaluator_traits<typename T::Rhs>::Shape,
|
||||||
typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
|
typename LhsScalar = typename traits<typename T::Lhs>::Scalar,
|
||||||
typename RhsScalar = typename traits<typename T::Rhs>::Scalar
|
typename RhsScalar = typename traits<typename T::Rhs>::Scalar,
|
||||||
|
typename = EnableIf<true> // extra template parameter for SFINAE-based specialization
|
||||||
> struct product_evaluator;
|
> struct product_evaluator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user