diff options
Diffstat (limited to 'include/ocl/tproc/rope.inl')
| -rw-r--r-- | include/ocl/tproc/rope.inl | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/include/ocl/tproc/rope.inl b/include/ocl/tproc/rope.inl index fe4218e..4158e16 100644 --- a/include/ocl/tproc/rope.inl +++ b/include/ocl/tproc/rope.inl @@ -8,78 +8,78 @@ namespace ocl::tproc::rope { - + template <typename It, class Pred> It find(It begin, It end, Pred pred) - { - for (auto it = begin; it != end; ++it) - { - if (*it == pred) - { - return it; - } - } + { + for (auto it = begin; it != end; ++it) + { + if (*it == pred) + { + return it; + } + } - return end; - } + return end; + } template <typename It, class Pred> It find_if(It begin, It end, Pred pred) - { - for (auto it = begin; it != end; ++it) - { - if (pred(it, pred)) - { - return it; - } - } + { + for (auto it = begin; it != end; ++it) + { + if (pred(it, pred)) + { + return it; + } + } - return end; - } + return end; + } template <typename It, class Pred> It::typename size_type erase(It begin, It end, Pred) - { - It original_begin = begin; - size_t count = 0; + { + It original_begin = begin; + size_t count = 0; - for (auto it = begin; it != end; ) - { - if (*it == pred) - { - it = begin.erase(it); - ++count; - } - else - { - ++it; - } - } + for (auto it = begin; it != end;) + { + if (*it == pred) + { + it = begin.erase(it); + ++count; + } + else + { + ++it; + } + } - return count; - } + return count; + } template <typename It, class Pred> It::typename size_type erase_if(It begin, It end, Pred) - { - It original_begin = begin; - size_t count = 0; + { + It original_begin = begin; + size_t count = 0; - for (auto it = begin; it != end; ) - { - if (pred(it, end) != end) - { - it = begin.erase(it); - ++count; - } - else - { - ++it; - } - } + for (auto it = begin; it != end;) + { + if (pred(it, end) != end) + { + it = begin.erase(it); + ++count; + } + else + { + ++it; + } + } - return count; - } + return count; + } } // namespace ocl::tproc::rope |
