From c924b4274949bda0283231d0039dd582d0bcd4b0 Mon Sep 17 00:00:00 2001 From: jakob lovhall Date: Thu, 30 Jun 2022 15:35:25 +0200 Subject: [PATCH] add forward reference assignment operator to function_output_iterator --- .../boost/iterator/function_output_iterator.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/boost/iterator/function_output_iterator.hpp b/include/boost/iterator/function_output_iterator.hpp index 51fe835..80c29c7 100644 --- a/include/boost/iterator/function_output_iterator.hpp +++ b/include/boost/iterator/function_output_iterator.hpp @@ -12,6 +12,11 @@ #define BOOST_ITERATOR_FUNCTION_OUTPUT_ITERATOR_HPP #include +#include + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +#include +#endif namespace boost { namespace iterators { @@ -33,10 +38,19 @@ namespace iterators { struct output_proxy { output_proxy(UnaryFunction& f) : m_f(f) { } + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES template output_proxy& operator=(const T& value) { m_f(value); return *this; } +#else + template output_proxy& operator=(T&& value) { + m_f(std::forward(value)); + return *this; + } +#endif + UnaryFunction& m_f; }; output_proxy operator*() { return output_proxy(m_f); }