84 lines
1.5 KiB
ReStructuredText
84 lines
1.5 KiB
ReStructuredText
|
|
.. _span-class:
|
|
|
|
Span
|
|
====
|
|
|
|
Identify an unowned contiguous memory range
|
|
|
|
Context
|
|
-------
|
|
|
|
.. ditaa::
|
|
:--scale: 0.85
|
|
|
|
+-----------------------------------------+----------+
|
|
| tokenizer | |
|
|
+-----------------------------------------+ |
|
|
| scan_result | |
|
|
+-----------------+-----------------------+ buffer |
|
|
| token | tokenizer_error | |
|
|
+-----------------+-----------------------+ |
|
|
| tokentype |cBLU span | |
|
|
+-----------------+-----------------------+----------+
|
|
|
|
.. code-block:: cpp
|
|
|
|
#include <xo/tokenizer/span.hpp>
|
|
|
|
.. uml::
|
|
:scale: 99%
|
|
:align: center
|
|
|
|
allowmixing
|
|
|
|
object span1<<span>>
|
|
span1 : lo = p
|
|
span2 : hi = p+25
|
|
|
|
object dest<<memory>>
|
|
dest : def fact(n : i64) { ... }
|
|
|
|
|
|
- Identify a sequence of characters stored in contiguous memory.
|
|
|
|
- Lightweight, consists of a pair of pointers.
|
|
|
|
- Does not own storage. Lifetime management for target memory is
|
|
up to the caller.
|
|
|
|
|
|
Class
|
|
-----
|
|
|
|
.. doxygenclass:: xo::scm::span
|
|
|
|
Member Variables
|
|
----------------
|
|
|
|
.. doxygengroup:: span-instance-vars
|
|
|
|
Type Traits
|
|
-----------
|
|
|
|
.. doxygengroup:: span-type-traits
|
|
|
|
Constructors
|
|
------------
|
|
|
|
.. doxygengroup:: span-ctors
|
|
|
|
Access Methods
|
|
--------------
|
|
|
|
.. doxygengroup:: span-access-methods
|
|
|
|
General Methods
|
|
---------------
|
|
|
|
.. doxygengroup:: span-general-methods
|
|
|
|
Operators
|
|
---------
|
|
|
|
.. doxygengroup:: span-operators
|