diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-08 09:22:55 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-08 09:22:55 +0100 |
| commit | 519f2f91dc3c5f465874c517c8d5c963e0444e45 (patch) | |
| tree | ef7c2b19e1b986254ed1549cc2dbd36d2f940036 | |
| parent | 2aafdb8520b302f01e57c677ec694db58527dddd (diff) | |
feat: `operator<<` for `crope` and `rope`.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | example/simple_example/example.cpp | 5 | ||||
| -rw-r--r-- | include/ocl/tproc/rope.hpp | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/example/simple_example/example.cpp b/example/simple_example/example.cpp index 445c92b..da543a9 100644 --- a/example/simple_example/example.cpp +++ b/example/simple_example/example.cpp @@ -6,6 +6,7 @@ */ #include <ocl/tproc/rope.hpp> +#include <iostream> #ifndef STANDALONE using namespace ocl; @@ -20,6 +21,6 @@ int main() std::unique_ptr<tproc::crope> new_elem(new tproc::crope(", and Jumps again.")); std::unique_ptr<tproc::crope> res(rope.concat(new_elem.get())); - io::println((++rope)->data()); - io::println(rope.data()); + std::cout << ++rope; + std::cout << rope; } diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp index 2a02f05..05e5399 100644 --- a/include/ocl/tproc/rope.hpp +++ b/include/ocl/tproc/rope.hpp @@ -194,4 +194,16 @@ namespace ocl::tproc } // namespace ocl::tproc +inline std::ostream & operator<<(std::ostream& os, ocl::tproc::crope& r){ + os << r.data(); + return os; +} + +inline std::wostream & operator<<(std::wostream& os, ocl::tproc::wrope& r){ + os << r.data(); + return os; +} + +#include "rope.inl" + #endif // __OCL_TPROC_ROPE_HPP |
