Skip to content

Commit

Permalink
Tweak docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonroelofs committed Feb 28, 2024
1 parent 380156d commit 1707d48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/stl/string_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

std::string_view
-----------------
``std::string_view`` is a read-only reference to a sequence of `char`s. It provides a way of passing strings without the overhead of copying `std::string`.
``std::string_view`` is a read-only reference to a sequence of ``char``. It provides a way of passing strings without the overhead of copying ``std::string``.

On input, Rice treats ``std::string_view`` as a Builtin type which means it copies the portion of the ``char`` sequence that a ``std::string_view`` references in C++ to Ruby. Please refer to the :ref:`_std_string_view` documentation to learn about how Rice handles encodings.my-refere
On input, Rice treats ``std::string_view`` as a Builtin type which means it copies the portion of the ``char`` sequence that a ``std::string_view`` references in C++ to Ruby. Please refer to the :ref:`std_string` documentation to learn about how Rice handles encodings.

On output, Rice creates a ``std::string_view`` that references a Ruby string's underlying `char` buffer. Note this is DANGEROUS. Sooner or later the Ruby string will be garbage collected or moved as part of compaction, thus invalidating the `char` buffer. So use this with caution.
On output, Rice creates a ``std::string_view`` that references a Ruby string's underlying ``char`` buffer. Note this is DANGEROUS. Sooner or later the Ruby string will be garbage collected or moved as part of compaction, thus invalidating the ``char`` buffer. So use this with caution.

0 comments on commit 1707d48

Please sign in to comment.