Repository: xtensor-stack/xtensor (language: python)

Issue:
Cannot update from 0.21.3 to 0.21.4
Build is all fine at version 0.21.3.

The full error message is in this file
[log.txt](https://github.com/xtensor-stack/xtensor/files/5602067/log.txt)

```
/home/zhuangyongwen/build/xtensor/include/xtensor/xtensor.hpp:518:21: error: no matching function for call to ‘xt::xiterator_owner_adaptor<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, xt::detail::expression_iterator_getter<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, (xt::layout_type)1> >::xiterator_owner_adaptor()’
         : base_type()
                     ^
In file included from /home/zhuangyongwen/build/xtensor/include/xtensor/xarray.hpp:19:0,
                 from /home/zhuangyongwen/build/xtensor/include/xtensor/xadapt.hpp:20,
                 from fbcdc.hpp:18,
                 from fbcdc_top.cpp:13:
/home/zhuangyongwen/build/xtensor/include/xtensor/xbuffer_adaptor.hpp:1092:12: note: candidate: xt::xiterator_owner_adaptor<C, IG>::xiterator_owner_adaptor(xt::xiterator_owner_adaptor<C, IG>::self_type&&) [with C = xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >; IG = xt::detail::expression_iterator_getter<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, (xt::layout_type)1>; xt::xiterator_owner_adaptor<C, IG>::self_type = xt::xiterator_owner_adaptor<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, xt::detail::expression_iterator_getter<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, (xt::layout_type)1> >]
     inline xiterator_owner_adaptor<C, IG>::xiterator_owner_adaptor(self_type&& rhs)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zhuangyongwen/build/xtensor/include/xtensor/xbuffer_adaptor.hpp:1092:12: note:   candidate expects 1 argument, 0 provided
/home/zhuangyongwen/build/xtensor/include/xtensor/xbuffer_adaptor.hpp:1078:12: note: candidate: xt::xiterator_owner_adaptor<C, IG>::xiterator_owner_adaptor(const self_type&) [with C = xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >; IG = xt::detail::expression_iterator_getter<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, (xt::layout_type)1>; xt::xiterator_owner_adaptor<C, IG>::self_type = xt::xiterator_owner_adaptor<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, xt::detail::expression_iterator_getter<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, (xt::layout_type)1> >]
     inline xiterator_owner_adaptor<C, IG>::xiterator_owner_adaptor(const self_type& rhs)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zhuangyongwen/build/xtensor/include/xtensor/xbuffer_adaptor.hpp:1078:12: note:   candidate expects 1 argument, 0 provided
/home/zhuangyongwen/build/xtensor/include/xtensor/xbuffer_adaptor.hpp:1071:12: note: candidate: xt::xiterator_owner_adaptor<C, IG>::xiterator_owner_adaptor(C&&) [with C = xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >; IG = xt::detail::expression_iterator_getter<xt::xview<xt::xarray_container<xt::uvector<short unsigned int, std::allocator<short unsigned int> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>&, xt::xall<long unsigned int>, xt::xrange<long int> >, (xt::layout_type)1>]
     inline xiterator_owner_adaptor<C, IG>::xiterator_owner_adaptor(C&& c)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zhuangyongwen/build/xtensor/include/xtensor/xbuffer_adaptor.hpp:1071:12: note:   candidate expects 1 argument, 0 provided
```


Discussion / hints:
Can you try with last version (i.e. 0.21.10)? Also check that you've upgraded the XTL accordingly.
Acctually, I failed to upgrade to the Master branch version first. And then try the tags one by one, finally find version 0.21.3 -> 0.21.4 cause something wrong.

The XTL is at its master.
Can I see the client code leading to this issue? Looks like you're using a non default constructible container as the data_container of your tensor, which is not possible (and I wonder how this could work with 0.21.3).
Finally i found out, it can be caused by these line:

```cpp
    {
      xt::xarray<T> patch = xt::zeros<T>({2, 8});
      xt::xarray<T> seq_r = xt::zeros<T>({16});
      xt::flatten(xt::view(patch, xt::all(), xt::range(0, 2))) = xt::view(seq_r, xt::range(0, 4));
    }
```

It's all fine at 0.21.3, and wrong at 0.21.4

@JohanMabille ?

Fix patch:
diff --git a/include/xtensor/xbuffer_adaptor.hpp b/include/xtensor/xbuffer_adaptor.hpp
index 1d7eaf3b9..aa94db3c4 100644
--- a/include/xtensor/xbuffer_adaptor.hpp
+++ b/include/xtensor/xbuffer_adaptor.hpp
@@ -596,6 +596,12 @@ namespace xt
         using type = typename xiterator_adaptor<I, CI>::temporary_type;
     };
 
+    template <class C, class IG>
+    struct temporary_container<xiterator_owner_adaptor<C, IG>>
+    {
+        using type = typename xiterator_owner_adaptor<C, IG>::temporary_type;
+    };
+
     template <class C>
     using temporary_container_t = typename temporary_container<C>::type;
 


Test patch:
diff --git a/test/test_xmanipulation.cpp b/test/test_xmanipulation.cpp
index aea7689df..fdd64c78d 100644
--- a/test/test_xmanipulation.cpp
+++ b/test/test_xmanipulation.cpp
@@ -172,6 +172,26 @@ namespace xt
         }
     }
 
+    TEST(xmanipulation, flatten_assign)
+    {
+      xt::xarray<int> patch = xt::zeros<int>({2, 8});
+      xt::xarray<int> seq_r = xt::zeros<int>({16});
+      seq_r[0] = 1;
+      seq_r[1] = 2;
+      seq_r[2] = 3;
+      seq_r[3] = 4;
+      xt::flatten(xt::view(patch, xt::all(), xt::range(0, 2))) = xt::view(seq_r, xt::range(0, 4));
+      EXPECT_EQ(patch(0, 0), 1);
+      EXPECT_EQ(patch(0, 1), 2);
+      EXPECT_EQ(patch(1, 0), 3);
+      EXPECT_EQ(patch(1, 1), 4);
+      for (size_t i = 2; i < 8; ++i)
+      {
+          EXPECT_EQ(patch(0, i), 0);
+          EXPECT_EQ(patch(1, i), 0);
+      }
+    }
+
     TEST(xmanipulation, flatnonzero)
     {
         xt::xtensor<int, 1> a = arange(-2, 3);
@@ -530,4 +550,9 @@ namespace xt
         ASSERT_EQ(8, repeated_array(3, 1));
         ASSERT_EQ(9, repeated_array(3, 2));
     }
+
+    TEST(xmanipulation, zzzzzz)
+    {
+
+    }
 }