xref: /freebsd/contrib/llvm-project/libc/src/__support/CPP/README.md (revision bb722a7d0f1642bff6487f943ad0427799a6e5bf)
1*bb722a7dSDimitry AndricThis directory contains partial re-implementations of some C++ standard library
2*bb722a7dSDimitry Andricutilities. They are for use with internal LLVM libc code and tests.
3*bb722a7dSDimitry Andric
4*bb722a7dSDimitry AndricMore utilities can be added on an as needed basis. There are certain rules to
5*bb722a7dSDimitry Andricbe followed for future changes and additions:
6*bb722a7dSDimitry Andric
7*bb722a7dSDimitry Andric1. Only two kind of headers can be included: Other headers from this directory,
8*bb722a7dSDimitry Andricand free standing C headers.
9*bb722a7dSDimitry Andric2. Free standing C headers are to be included as C headers and not as C++
10*bb722a7dSDimitry Andricheaders. That is, use `#include <stddef.h>` and not `#include <cstddef>`.
11*bb722a7dSDimitry Andric3. The utilities should be defined in the namespace `LIBC_NAMESPACE::cpp`. The
12*bb722a7dSDimitry Andrichigher level namespace should have a `__` prefix to avoid symbol name pollution
13*bb722a7dSDimitry Andricwhen the utilities are used in implementation of public functions.
14