From 14f537c296710173c76379d8efec59bfb1d78eb7 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 16 Jan 2015 09:09:23 -0800 Subject: gcc doesn't consider that template TensorStridingOp& operator = (const OtherDerived& other) provides a valid assignment operator for the striding operation, and therefore refuses to compile code like: result.stride(foo) = source.stride(bar); Added the explicit TensorStridingOp& operator = (const TensorStridingOp& other) as a workaround to get the code to compile, and did the same in all the operations that can be used as lvalues. --- unsupported/test/cxx11_tensor_shuffling.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'unsupported/test/cxx11_tensor_shuffling.cpp') diff --git a/unsupported/test/cxx11_tensor_shuffling.cpp b/unsupported/test/cxx11_tensor_shuffling.cpp index ec623e1f9..2f7fd9e50 100644 --- a/unsupported/test/cxx11_tensor_shuffling.cpp +++ b/unsupported/test/cxx11_tensor_shuffling.cpp @@ -157,6 +157,23 @@ static void test_shuffling_as_value() } } } + + array no_shuffle; + no_shuffle[0] = 0; + no_shuffle[1] = 1; + no_shuffle[2] = 2; + no_shuffle[3] = 3; + Tensor shuffle2(5,7,3,2); + shuffle2.shuffle(shuffles) = tensor.shuffle(no_shuffle); + for (int i = 0; i < 5; ++i) { + for (int j = 0; j < 7; ++j) { + for (int k = 0; k < 3; ++k) { + for (int l = 0; l < 2; ++l) { + VERIFY_IS_EQUAL(shuffle2(i,j,k,l), shuffle(i,j,k,l)); + } + } + } + } } void test_cxx11_tensor_shuffling() -- cgit v1.2.3