summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/ocl/tproc/detail/rope_fwd.hpp19
-rw-r--r--include/ocl/tproc/detail/rope_fwd.inl20
-rw-r--r--src/tproc/rope_impl.cpp7
-rw-r--r--test/rope_test/crope.test.cpp7
4 files changed, 30 insertions, 23 deletions
diff --git a/include/ocl/tproc/detail/rope_fwd.hpp b/include/ocl/tproc/detail/rope_fwd.hpp
index f46d0f4..c9c3567 100644
--- a/include/ocl/tproc/detail/rope_fwd.hpp
+++ b/include/ocl/tproc/detail/rope_fwd.hpp
@@ -6,8 +6,8 @@
#ifndef OCL_TPROC_ROPE_FWD_HPP
#define OCL_TPROC_ROPE_FWD_HPP
-#include <memory>
#include <boost/utility/string_view.hpp>
+#include <memory>
/// \file rope_fwd.hpp
/// \brief Basic forward definitions of the `rope` type.
@@ -31,23 +31,16 @@ public:
using const_pointer = std::allocator_traits<Allocator>::pointer;
CharT *begin();
-
CharT *end();
-
size_type size();
-
bool empty() const;
- ~basic_rope() = default;
- basic_rope(const boost::string_view& in = {});
+ ~basic_rope();
+ basic_rope(const boost::basic_string_view<CharT> &in = {});
private:
- struct impl;
- std::unique_ptr<impl> impl_;
-
-#if !defined(OCL_ROPE_IMPL)
- struct impl {};
-#endif
+ struct tree_impl;
+ std::unique_ptr<tree_impl> impl_;
};
#if __cplusplus >= 201811L
@@ -59,4 +52,6 @@ using wrope = basic_rope<wchar_t>;
} // namespace ocl
+#include "rope_fwd.inl"
+
#endif
diff --git a/include/ocl/tproc/detail/rope_fwd.inl b/include/ocl/tproc/detail/rope_fwd.inl
new file mode 100644
index 0000000..5ca6bf4
--- /dev/null
+++ b/include/ocl/tproc/detail/rope_fwd.inl
@@ -0,0 +1,20 @@
+// Copyright 2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// Official repository: https://github.com/ocl-org/tproc
+
+#ifndef OCL_TPROC_ROPE_FWD_INL
+#define OCL_TPROC_ROPE_FWD_INL
+
+namespace ocl {
+
+template <class CharT> struct basic_rope<CharT>::tree_impl {};
+
+template <class CharT> basic_rope<CharT>::~basic_rope() = default;
+
+template <class CharT>
+basic_rope<CharT>::basic_rope(const boost::basic_string_view<CharT> &in) {}
+
+} // namespace ocl
+
+#endif \ No newline at end of file
diff --git a/src/tproc/rope_impl.cpp b/src/tproc/rope_impl.cpp
deleted file mode 100644
index 2e5cdf2..0000000
--- a/src/tproc/rope_impl.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2025, Amlal El Mahrouss (amlal@nekernel.org)
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-// Official repository: https://github.com/ocl-org/tproc
-
-#define OCL_ROPE_IMPL 1
-#include <ocl/tproc/rope.hpp>
diff --git a/test/rope_test/crope.test.cpp b/test/rope_test/crope.test.cpp
index e1885f4..f454e12 100644
--- a/test/rope_test/crope.test.cpp
+++ b/test/rope_test/crope.test.cpp
@@ -10,8 +10,7 @@
#define BOOST_TEST_MODULE crope
#include <boost/test/included/unit_test.hpp>
-BOOST_AUTO_TEST_CASE( allocator_should_succeed )
-{
- auto rope = ocl::crope("foo");
- BOOST_TEST( rope.empty() == false );
+BOOST_AUTO_TEST_CASE(allocator_should_succeed) {
+ auto rope = ocl::crope("foo");
+ BOOST_TEST(rope.empty() == false);
}