Skip to content

Commit 8cc1d2b

Browse files
committed
P1642R11 Freestanding Library: Easy [utilities], [ranges], and [iterators]
1 parent d696d94 commit 8cc1d2b

File tree

10 files changed

+790
-639
lines changed

10 files changed

+790
-639
lines changed

source/concepts.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169

170170
\indexheader{concepts}%
171171
\begin{codeblock}
172+
// all freestanding
172173
namespace std {
173174
// \ref{concepts.lang}, language-related concepts
174175
// \ref{concept.same}, concept \libconcept{same_as}

source/intro.tex

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -840,12 +840,16 @@
840840

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

850854
\pnum
851855
A conforming implementation may have extensions (including

source/iterators.tex

Lines changed: 148 additions & 138 deletions
Large diffs are not rendered by default.

source/lib-intro.tex

Lines changed: 65 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,51 @@
904904
\pnum
905905
An implementation may use any technique that provides equivalent observable behavior.
906906

907+
\rSec3[freestanding.entity]{Freestanding entities}
908+
909+
\pnum
910+
A \defnadj{freestanding}{entity} is a declaration or macro definition
911+
that is present in a freestanding implementation and a hosted implementation.
912+
913+
\pnum
914+
Unless otherwise specified,
915+
the requirements on freestanding entities on a freestanding implementation
916+
are the same as the corresponding requirements in a hosted implementation.
917+
918+
\pnum
919+
In a header synopsis, entities followed with a comment
920+
that includes \textit{freestanding} are freestanding entities.
921+
\begin{example}
922+
\begin{codeblock}
923+
#define NULL see below // freestanding
924+
\end{codeblock}
925+
\end{example}
926+
927+
\pnum
928+
If a header synopsis begins with a comment
929+
that includes \textit{all freestanding},
930+
then all of the declarations and macro definitions in the header synopsis
931+
are freestanding entities.
932+
\begin{example}
933+
\begin{codeblock}
934+
// all freestanding
935+
namespace std {
936+
\end{codeblock}
937+
\end{example}
938+
939+
\pnum
940+
Deduction guides for freestanding entity class templates are freestanding entities.
941+
942+
\pnum
943+
Enclosing namespaces of freestanding entities are freestanding entities.
944+
945+
\pnum
946+
Friends of freestanding entities are freestanding entities.
947+
948+
\pnum
949+
Entities denoted by freestanding entity \grammarterm{typedef-names} and
950+
freestanding entity alias templates are freestanding entities.
951+
907952
\rSec1[requirements]{Library-wide requirements}
908953

909954
\rSec2[requirements.general]{General}
@@ -1342,38 +1387,31 @@
13421387
\ref{concepts} & Concepts library & \tcode{<concepts>} \\ \rowsep
13431388
\ref{type.traits} & Type traits & \tcode{<type_traits>} \\ \rowsep
13441389
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
1345-
\ref{atomics} & Atomics & \tcode{<atomic>} \\
1390+
\ref{atomics} & Atomics & \tcode{<atomic>} \\ \rowsep
1391+
\ref{utility} & Utility components & \tcode{<utility>} \\ \rowsep
1392+
\ref{tuple} & Tuples & \tcode{<tuple>} \\ \rowsep
1393+
\ref{memory} & Memory & \tcode{<memory>} \\ \rowsep
1394+
\ref{function.objects} & Function objects & \tcode{<functional>} \\ \rowsep
1395+
\ref{ratio} & Compile-time rational arithmetic & \tcode{<ratio>} \\ \rowsep
1396+
\ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
1397+
\ref{ranges} & Ranges library & \tcode{<ranges>} \\
13461398
\end{libsumtab}
13471399

13481400
\pnum
1349-
The supplied version of the header \libheaderref{cstdlib}
1350-
shall declare at least the functions
1351-
\indexlibraryglobal{abort}%
1352-
\tcode{abort},
1353-
\indexlibraryglobal{atexit}%
1354-
\tcode{atexit},
1355-
\indexlibraryglobal{at_quick_exit}%
1356-
\tcode{at_quick_exit},
1357-
\indexlibraryglobal{exit}%
1358-
\tcode{exit},
1359-
and
1360-
\indexlibraryglobal{quick_exit}%
1361-
\tcode{quick_exit}\iref{support.start.term}.
1362-
\indextext{implementation!hosted}%
1363-
The supplied version of the header \libheaderrefx{atomic}{atomics.syn}
1364-
shall meet the same requirements as for a hosted implementation
1365-
except that support for
1366-
always lock-free integral atomic types\iref{atomics.lockfree}
1367-
is \impldef{support for always lock-free integral atomic types in
1368-
freestanding environments}, and
1369-
whether or not the type aliases \tcode{atomic_signed_lock_free} and
1370-
\tcode{atomic_unsigned_lock_free} are defined\iref{atomics.alias}
1371-
is \impldef{type aliases \tcode{atomic_signed_lock_free} and
1372-
\tcode{atomic_unsigned_lock_free} in freestanding environments}.
1373-
The other headers listed in this table
1374-
shall meet the same requirements as for a hosted implementation.
1401+
For each of the headers listed in \tref{headers.cpp.fs},
1402+
a freestanding implementation provides at least
1403+
the freestanding entities\iref{freestanding.entity} declared in the header.
13751404
\indextext{implementation!freestanding|)}%
13761405

1406+
\pnum
1407+
\begin{note}
1408+
Throwing a standard library provided exception
1409+
is not observably different from \tcode{terminate()}
1410+
if the implementation does not
1411+
unwind the stack during exception handling\iref{except.handle} and
1412+
the user's program contains no catch blocks.
1413+
\end{note}
1414+
13771415
\rSec2[using]{Using the library}
13781416

13791417
\rSec3[using.overview]{Overview}

0 commit comments

Comments
 (0)