summaryrefslogtreecommitdiffhomepage
path: root/include/ocl
diff options
context:
space:
mode:
Diffstat (limited to 'include/ocl')
-rw-r--r--include/ocl/tproc/detail/rope_fwd.hpp2
-rw-r--r--include/ocl/tproc/detail/rope_fwd.inl20
-rw-r--r--include/ocl/tproc/rope.hpp12
3 files changed, 23 insertions, 11 deletions
diff --git a/include/ocl/tproc/detail/rope_fwd.hpp b/include/ocl/tproc/detail/rope_fwd.hpp
index 7a9bca5..f694269 100644
--- a/include/ocl/tproc/detail/rope_fwd.hpp
+++ b/include/ocl/tproc/detail/rope_fwd.hpp
@@ -11,7 +11,7 @@
/// \file rope_fwd.hpp
/// \brief Basic forward definitions of the `rope` type.
-namespace ocl
+namespace ocl::tproc
{
/// \brief This class implements a rope type for any **CharT** type.
diff --git a/include/ocl/tproc/detail/rope_fwd.inl b/include/ocl/tproc/detail/rope_fwd.inl
index 852e065..11ed792 100644
--- a/include/ocl/tproc/detail/rope_fwd.inl
+++ b/include/ocl/tproc/detail/rope_fwd.inl
@@ -6,12 +6,18 @@
#ifndef OCL_TPROC_ROPE_FWD_INL
#define OCL_TPROC_ROPE_FWD_INL
-namespace ocl
+namespace ocl::tproc
{
template <class CharT, class Traits, class Allocator>
struct basic_rope<CharT, Traits, Allocator>::tree_impl
{
+ size_t size_;
+ CharT* head_, tail_;
+
+ size_t size() { return size_; }
+ CharT* begin() { return head_; }
+ CharT* end() { return tail_; }
};
template <class CharT, class Traits, class Allocator>
@@ -24,7 +30,7 @@ namespace ocl
template <class CharT, class Traits, class Allocator>
basic_rope<CharT, Traits, Allocator>&
basic_rope<CharT, Traits, Allocator>::operator=(
- basic_rope<CharT, Traits, Allocator>&& rope)
+ basic_rope<CharT, Traits, Allocator>&& other)
{
impl_ = std::exchange(other.impl_);
return *this;
@@ -32,7 +38,7 @@ namespace ocl
template <class CharT, class Traits, class Allocator>
basic_rope<CharT, Traits, Allocator>::basic_rope(
- basic_rope<CharT, Traits, Allocator>&& rope)
+ basic_rope<CharT, Traits, Allocator>&& other)
{
impl_ = std::exchange(other.impl_);
rope.impl_ = nullptr;
@@ -48,26 +54,26 @@ namespace ocl
template <class CharT, class Traits, class Allocator>
CharT* basic_rope<CharT, Traits, Allocator>::begin()
{
- return nullptr;
+ return impl_->begin();
}
template <class CharT, class Traits, class Allocator>
CharT* basic_rope<CharT, Traits, Allocator>::end()
{
- return nullptr;
+ return impl_->end();
}
template <class CharT, class Traits, class Allocator>
basic_rope<CharT, Traits, Allocator>::size_type
basic_rope<CharT, Traits, Allocator>::size()
{
- return 0UL;
+ return impl_->size();
}
template <class CharT, class Traits, class Allocator>
bool basic_rope<CharT, Traits, Allocator>::empty() const
{
- return true;
+ return impl_->size() < 1;
}
} // namespace ocl
diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp
index 9a072c9..c0fd756 100644
--- a/include/ocl/tproc/rope.hpp
+++ b/include/ocl/tproc/rope.hpp
@@ -8,14 +8,20 @@
#include <ocl/tproc/detail/rope_fwd.hpp>
-namespace ocl::tproc
+namespace ocl::tproc::rope
{
template <typename It, class Pred>
- It find(It begin, It end, Pred callable);
+ It find(It begin, It end, Pred);
template <typename It, class Callable>
- It find_if(It begin, It end, Callable callable);
+ It find_if(It begin, It end, Callable);
+
+ template <typename It, class Pred>
+ size_t erase(It begin, It end, Pred);
+
+ template <typename It, class Callable>
+ size_t erase_if(It begin, It end, Callable);
} // namespace ocl::tproc