00001 #ifndef _COPY_IF_H
00002 #define _COPY_IF_H
00003
00004 namespace osl
00005 {
00006 namespace stl
00007 {
00013 template<class InputIterator, class OutputIterator, class Predicate>
00014 inline OutputIterator copy_if(InputIterator first,
00015 InputIterator last,
00016 OutputIterator result,
00017 Predicate predicate)
00018 {
00019 while (first != last) {
00020 if (predicate(*first)) {
00021 *result++ = *first;
00022 }
00023 ++first;
00024 }
00025 return result;
00026 }
00027 }
00028 }
00029
00030 #endif
00031
00032
00033
00034