diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-25 21:24:57 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-25 21:24:57 +0100 |
| commit | a5fbde90e35c3ed38a70377249a0e0ecd91901ab (patch) | |
| tree | 3caf72aa8ccc7b90ad9d04fc2180a84a1a5dda84 /include/ocl | |
| parent | a3b23dcaabb53b8770c6ac8cfc33c6002b815589 (diff) | |
feat: fix rope detail implementation.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/ocl')
| -rw-r--r-- | include/ocl/tproc/detail/rope_fwd.hpp | 4 | ||||
| -rw-r--r-- | include/ocl/tproc/detail/rope_fwd.inl | 14 |
2 files changed, 7 insertions, 11 deletions
diff --git a/include/ocl/tproc/detail/rope_fwd.hpp b/include/ocl/tproc/detail/rope_fwd.hpp index eadefce..7a9bca5 100644 --- a/include/ocl/tproc/detail/rope_fwd.hpp +++ b/include/ocl/tproc/detail/rope_fwd.hpp @@ -38,8 +38,8 @@ namespace ocl ~basic_rope(); basic_rope(const boost::core::basic_string_view<CharT>& in = {}); - basic_rope& operator=(const basic_rope&& rope); - basic_rope(const basic_rope&& rope); + basic_rope& operator=(basic_rope&& rope); + basic_rope(basic_rope&& rope); private: struct tree_impl; diff --git a/include/ocl/tproc/detail/rope_fwd.inl b/include/ocl/tproc/detail/rope_fwd.inl index 0dd1e92..852e065 100644 --- a/include/ocl/tproc/detail/rope_fwd.inl +++ b/include/ocl/tproc/detail/rope_fwd.inl @@ -24,22 +24,18 @@ namespace ocl template <class CharT, class Traits, class Allocator> basic_rope<CharT, Traits, Allocator>& basic_rope<CharT, Traits, Allocator>::operator=( - const basic_rope<CharT, Traits, Allocator>&& rope) + basic_rope<CharT, Traits, Allocator>&& rope) { - delete this->impl_; - this->impl_ = rope.impl_; - rope.impl_ = nullptr; - + impl_ = std::exchange(other.impl_); return *this; } template <class CharT, class Traits, class Allocator> basic_rope<CharT, Traits, Allocator>::basic_rope( - const basic_rope<CharT, Traits, Allocator>&& rope) + basic_rope<CharT, Traits, Allocator>&& rope) { - delete this->impl_; - this->impl_ = rope.impl_; - rope.impl_ = nullptr; + impl_ = std::exchange(other.impl_); + rope.impl_ = nullptr; } template <class CharT, class Traits, class Allocator> |
