From f218c0181d44d7dd129a77108ad6ec063cfbd6cc Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 16 Mar 2015 13:05:00 -0700 Subject: Fixes the Lvalue computation by actually setting the LvalueBit properly when instantiating tensors of const T. Added a test to check the fix. --- unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h index a844a4d68..66ddfd554 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h @@ -54,7 +54,7 @@ struct traits > static const int Layout = Options_ & RowMajor ? RowMajor : ColMajor; enum { Options = Options_, - Flags = compute_tensor_flags::ret | LvalueBit, + Flags = compute_tensor_flags::ret | (is_const::value ? 0 : LvalueBit), }; }; @@ -69,7 +69,7 @@ struct traits > static const int Layout = Options_ & RowMajor ? RowMajor : ColMajor; enum { Options = Options_, - Flags = compute_tensor_flags::ret | LvalueBit, + Flags = compute_tensor_flags::ret | (is_const::value ? 0: LvalueBit), }; }; @@ -86,7 +86,7 @@ struct traits > static const int Layout = BaseTraits::Layout; enum { Options = Options_, - Flags = ((BaseTraits::Flags | LvalueBit) & ~AlignedBit) | (Options&Aligned ? AlignedBit : 0), + Flags = (BaseTraits::Flags & ~AlignedBit) | (Options&Aligned ? AlignedBit : 0), }; }; @@ -102,7 +102,7 @@ struct traits > static const int Layout = BaseTraits::Layout; enum { Options = BaseTraits::Options, - Flags = ((BaseTraits::Flags | LvalueBit) & ~AlignedBit) | (Options&Aligned ? AlignedBit : 0), + Flags = (BaseTraits::Flags & ~AlignedBit) | (Options&Aligned ? AlignedBit : 0), }; }; -- cgit v1.2.3