From 4a4ae462fb9cbf9fffbaf302799fe0d80c652227 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 21 Sep 2012 14:49:32 +0000 Subject: [PATCH] Fix bugs in copy_if; add basic tests. Refs #7400. Thanks to Hideaki Takei for the catch [SVN r80617] --- include/boost/algorithm/cxx11/copy_if.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/algorithm/cxx11/copy_if.hpp b/include/boost/algorithm/cxx11/copy_if.hpp index 6d0ba00..8591cb5 100644 --- a/include/boost/algorithm/cxx11/copy_if.hpp +++ b/include/boost/algorithm/cxx11/copy_if.hpp @@ -39,7 +39,7 @@ OutputIterator copy_if ( InputIterator first, InputIterator last, OutputIterator { for ( ; first != last; ++first ) if (p(*first)) - *result++ = first; + *result++ = *first; return result; } #endif @@ -75,7 +75,7 @@ OutputIterator copy_while ( InputIterator first, InputIterator last, OutputIterator result, Predicate p ) { for ( ; first != last && p(*first); ++first ) - *result++ = first; + *result++ = *first; return result; } @@ -109,7 +109,7 @@ template OutputIterator copy_until ( InputIterator first, InputIterator last, OutputIterator result, Predicate p ) { for ( ; first != last && !p(*first); ++first ) - *result++ = first; + *result++ = *first; return result; }