third_party.pigweed.src/pw_containers/docs.rst
Wyatt Hepler 3c4e5de42f Add or expand docs.rst
Change-Id: I18d1529088beb41b37be00a77ba8999f6b6f810a
2020-03-05 02:00:04 +00:00

31 lines
893 B
ReStructuredText

.. default-domain:: cpp
.. highlight:: sh
-------------
pw_containers
-------------
The pw_containers module provides embedded-friendly container classes.
pw_vector
=========
The Vector class is similar to std::vector, except it is backed by a
fixed-size buffer. Vectors must be declared with an explicit maximum size
(e.g. ``Vector<int, 10>``) but vectors can be used and referred to without the
max size template parameter (e.g. ``Vector<int>``).
To allow referring to a ``pw::Vector`` without an explicit maximum size, all
Vector classes inherit from the generic ``Vector<T>``, which stores the maximum
size in a variable. This allows Vectors to be used without having to know
their maximum size at compile time. It also keeps code size small since
function implementations are shared for all maximum sizes.
Compatibility
=============
* C
* C++17
Dependencies
============
* pw_span