xo-umbrella2/xo-flatstring/docs/index.rst
Roland Conybeare fa57de89fe git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring
subrepo:
  subdir:   "xo-flatstring"
  merged:   "996c220e"
upstream:
  origin:   "git@github.com:Rconybea/xo-flatstring"
  branch:   "main"
  commit:   "996c220e"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 21:34:32 -04:00

38 lines
1.2 KiB
ReStructuredText

xo-flatstring documentation master file
xo-flatstring documentation
===========================
xo-flatstring is a lightweight header-only library that provides a constexpr
fixed-size no-allocation string implementation.
Why ``flatstring``?
1. ``flatstring`` instances can be used as template arguments. [1]_
2. ``flatstring`` operations (construction, concatenation, ...) are ``constexpr``, so can be done at compile time. [2]_
3. a ``flatstring`` expression can occupy both compile-time and runtime roles. [3]_
.. [1] A fixed-size char array *can* be used as a template
argument, but char* pointers cannot. Automatic conversion of char arrays to pointers in various contexts
makes them difficult to work with in c++ templates.
.. [2] Although allocation is permitted in constexpr code, it's subject to several restrictions.
it's not yet possible (as of c++23) to use ``std::string`` at compile time.
.. [3] contrast with a solution relying on template arguments, which must then be compile-time-only.
.. toctree::
:maxdepth: 2
:caption: xo-flatstring contents:
install
lessons
flatstring-reference
Indices and Tables
------------------
* :ref:`genindex`
* :ref:`search`