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