Created
December 10, 2015 07:24
-
-
Save 30mb1/af0a121e7581c637e4e4 to your computer and use it in GitHub Desktop.
B1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename SourceIterator, typename DestinationIterator, typename Predicate> | |
DestinationIterator copy_backward_if(SourceIterator source_first, SourceIterator source_last, DestinationIterator destination_last, Predicate condition) { | |
while (source_last != source_first) { | |
if (condition(*source_first)) { | |
*(--destination_last) = *source_first; | |
} | |
++source_first; | |
} | |
return destination_last; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment