Skip to content

P1642R11 Freestanding Library: Easy [utilities], [ranges], and [iterators] #5713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/concepts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@

\indexheader{concepts}%
\begin{codeblock}
// all freestanding
namespace std {
// \ref{concepts.lang}, language-related concepts
// \ref{concept.same}, concept \libconcept{same_as}
Expand Down
14 changes: 9 additions & 5 deletions source/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -844,12 +844,16 @@

\pnum
Two kinds of implementations are defined: a \defnadj{hosted}{implementation} and a
\defnadj{freestanding}{implementation}. For a hosted implementation, this
document defines the set of available libraries. A freestanding
\defnadj{freestanding}{implementation}.
A freestanding
implementation is one in which execution may take place without the benefit of
an operating system, and has an \impldef{required libraries for freestanding
implementation} set of libraries that includes certain language-support
libraries\iref{compliance}.
an operating system.
A hosted implementation
supports all the facilities described in this document, while
a freestanding implementation
supports the entire \Cpp{} language
described in \ref{lex} through \ref{cpp} and
the subset of the library facilities described in \ref{compliance}.

\pnum
A conforming implementation may have extensions (including
Expand Down
289 changes: 152 additions & 137 deletions source/iterators.tex

Large diffs are not rendered by default.

93 changes: 66 additions & 27 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,52 @@
\pnum
An implementation may use any technique that provides equivalent observable behavior.

\rSec3[freestanding.entity]{Freestanding entities}

\pnum
\indextext{entity!freestanding|see{freestanding entity}}%
A \defn{freestanding entity} is a declaration or macro definition
that is present in a freestanding implementation and a hosted implementation.

\pnum
Unless otherwise specified,
the requirements on freestanding entities on a freestanding implementation
are the same as the corresponding requirements in a hosted implementation.

\pnum
In a header synopsis, entities followed with a comment
that includes \textit{freestanding} are freestanding entities.
\begin{example}
\begin{codeblock}
#define NULL @\seebelow@ // freestanding
\end{codeblock}
\end{example}

\pnum
If a header synopsis begins with a comment
that includes \textit{all freestanding},
then all of the declarations and macro definitions in the header synopsis
are freestanding entities.
\begin{example}
\begin{codeblock}
// all freestanding
namespace std {
\end{codeblock}
\end{example}

\pnum
Deduction guides for freestanding entity class templates are freestanding entities.

\pnum
Enclosing namespaces of freestanding entities are freestanding entities.

\pnum
Friends of freestanding entities are freestanding entities.

\pnum
Entities denoted by freestanding entity \grammarterm{typedef-name}{s} and
freestanding entity alias templates are freestanding entities.

\rSec1[requirements]{Library-wide requirements}

\rSec2[requirements.general]{General}
Expand Down Expand Up @@ -1350,38 +1396,31 @@
\ref{concepts} & Concepts library & \tcode{<concepts>} \\ \rowsep
\ref{type.traits} & Type traits & \tcode{<type_traits>} \\ \rowsep
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
\ref{atomics} & Atomics & \tcode{<atomic>} \\
\ref{atomics} & Atomics & \tcode{<atomic>} \\ \rowsep
\ref{utility} & Utility components & \tcode{<utility>} \\ \rowsep
\ref{tuple} & Tuples & \tcode{<tuple>} \\ \rowsep
\ref{memory} & Memory & \tcode{<memory>} \\ \rowsep
\ref{function.objects} & Function objects & \tcode{<functional>} \\ \rowsep
\ref{ratio} & Compile-time rational arithmetic & \tcode{<ratio>} \\ \rowsep
\ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
\ref{ranges} & Ranges library & \tcode{<ranges>} \\
\end{libsumtab}

\pnum
The supplied version of the header \libheaderref{cstdlib}
shall declare at least the functions
\indexlibraryglobal{abort}%
\tcode{abort},
\indexlibraryglobal{atexit}%
\tcode{atexit},
\indexlibraryglobal{at_quick_exit}%
\tcode{at_quick_exit},
\indexlibraryglobal{exit}%
\tcode{exit},
and
\indexlibraryglobal{quick_exit}%
\tcode{quick_exit}\iref{support.start.term}.
\indextext{implementation!hosted}%
The supplied version of the header \libheaderrefx{atomic}{atomics.syn}
shall meet the same requirements as for a hosted implementation
except that support for
always lock-free integral atomic types\iref{atomics.lockfree}
is \impldef{support for always lock-free integral atomic types in
freestanding environments}, and
whether or not the type aliases \tcode{atomic_signed_lock_free} and
\tcode{atomic_unsigned_lock_free} are defined\iref{atomics.alias}
is \impldef{type aliases \tcode{atomic_signed_lock_free} and
\tcode{atomic_unsigned_lock_free} in freestanding environments}.
The other headers listed in this table
shall meet the same requirements as for a hosted implementation.
For each of the headers listed in \tref{headers.cpp.fs},
a freestanding implementation provides at least
the freestanding entities\iref{freestanding.entity} declared in the header.
\indextext{implementation!freestanding|)}%

\pnum
\begin{note}
Throwing a standard library provided exception
is not observably different from \tcode{terminate()}
if the implementation does not
unwind the stack during exception handling\iref{except.handle} and
the user's program contains no catch blocks.
\end{note}

\rSec2[using]{Using the library}

\rSec3[using.overview]{Overview}
Expand Down
Loading