<div dir="ltr">Hi,<br><br>I have the following piece of code:<br><br>    std::vector&lt;std::string&gt; list1;<br>    std::vector&lt;std::string&gt; list2; <br>    push_back(list2, list1<br>        | transformed([](const auto&amp; w) { return w; })<br>        | sliced(0, 1));<br><br>This compiles fine with CLang, but with GCC I get the error:<br><br>    /usr/include/boost/optional/optional.hpp:546:64: error: use of deleted function &#39;main(int, const char**)::&lt;lambda(const auto:1&amp;)&gt;&amp; main(int, const char**)::&lt;lambda(const auto:1&amp;)&gt;::operator=(const main(int, const char**)::&lt;lambda(const auto:1&amp;)&gt;&amp;)&#39;<br>     void assign_value ( rval_reference_type val ) { get_impl() = static_cast&lt;rval_reference_type&gt;(val); }<br><br>                                                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>   main.cpp:46:19: note: a lambda closure type has a deleted copy assignment operator<br>    | transformed([](const auto&amp; w) { return w; })<br><br><br>When I replace the lambda by a regular function, the code compiles; when I don&#39;t use &#39;sliced&#39; (but pipe it to e.g. &#39;transformed&#39; instead), the code also compiles.<br><br>Is there a way to make this code compile with a lambda?<br><br>thanks!<br>Remko<br><br>PS: I&#39;m using GCC 6.2.0 with Boost 1.61.<br></div>