summaryrefslogtreecommitdiffhomepage
path: root/include/ocl/tproc/rope.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/ocl/tproc/rope.hpp')
-rw-r--r--include/ocl/tproc/rope.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp
index 26729b0..21277f2 100644
--- a/include/ocl/tproc/rope.hpp
+++ b/include/ocl/tproc/rope.hpp
@@ -35,6 +35,30 @@ namespace ocl::tproc::rope
}
};
+ /// \brief ends with pred type.
+ template <typename It>
+ class ends_with_pred final
+ {
+ It cond_;
+
+ public:
+ ends_with_pred(const boost::core::basic_string_view<typename It::value_type>& cond)
+ : cond_(cond)
+ {
+ }
+
+ It* operator()(It* begin, It* end)
+ {
+ for (auto beg{begin}; beg != end; ++beg)
+ {
+ if (beg->ends_with(cond_.data()))
+ return beg;
+ }
+
+ return end;
+ }
+ };
+
template <typename It>
class uppercase_pred final
{