Add String and Str iterators
diff --git a/include/cxx.h b/include/cxx.h
index 5725be9..8624233 100644
--- a/include/cxx.h
+++ b/include/cxx.h
@@ -48,6 +48,16 @@
size_t size() const noexcept;
size_t length() const noexcept;
+ using iterator = char *;
+ iterator begin() noexcept;
+ iterator end() noexcept;
+
+ using const_iterator = const char *;
+ const_iterator begin() const noexcept;
+ const_iterator end() const noexcept;
+ const_iterator cbegin() const noexcept;
+ const_iterator cend() const noexcept;
+
// Internal API only intended for the cxxbridge code generator.
String(unsafe_bitcopy_t, const String &) noexcept;
@@ -78,6 +88,13 @@
Str(const Str &) noexcept = default;
~Str() noexcept = default;
+ using iterator = const char *;
+ using const_iterator = const char *;
+ const_iterator begin() const noexcept;
+ const_iterator end() const noexcept;
+ const_iterator cbegin() const noexcept;
+ const_iterator cend() const noexcept;
+
private:
friend impl<Str>;
// Not necessarily ABI compatible with &str. Codegen will translate to