Merge pull request #46 from jeanphilippeD/lambda_copy_transform_it

Allow iterator copy for lambda in transformed and filtered
This commit is contained in:
neilgroves authored and GitHub committed 2017-06-30 12:43:38 +01:00
commit 796080bbb8
3 files changed
+101 -10

No files matched your search

@@ -32,6 +32,23 @@ public:
: m_impl(source)
{
}
default_constructible_unary_fn_wrapper(const default_constructible_unary_fn_wrapper& source)
: m_impl(source.m_impl)
{
}
default_constructible_unary_fn_wrapper& operator=(const default_constructible_unary_fn_wrapper& source)
{
if (source.m_impl)
{
// Lambda are not copy/move assignable.
m_impl.emplace(*source.m_impl);
}
else
{
m_impl.reset();
}
return *this;
}
template<typename Arg>
R operator()(const Arg& arg) const
{