Skip to content

Commit 16cfab2

Browse files
committed
Merge 2018-03 LWG Motion 13
2 parents 6073e4b + 5e956d7 commit 16cfab2

File tree

5 files changed

+129
-13
lines changed

5 files changed

+129
-13
lines changed

source/iostreams.tex

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,10 @@
23482348

23492349
\rSec3[fmtflags.manip]{\tcode{fmtflags} manipulators}
23502350

2351+
\pnum
2352+
Each function specified in this subclause
2353+
is a designated addressable function\iref{namespace.std}.
2354+
23512355
\indexlibrary{\idxcode{boolalpha}}%
23522356
\begin{itemdecl}
23532357
ios_base& boolalpha(ios_base& str);
@@ -2574,6 +2578,10 @@
25742578

25752579
\rSec3[adjustfield.manip]{\tcode{adjustfield} manipulators}
25762580

2581+
\pnum
2582+
Each function specified in this subclause
2583+
is a designated addressable function\iref{namespace.std}.
2584+
25772585
\indexlibrary{\idxcode{internal}}%
25782586
\begin{itemdecl}
25792587
ios_base& internal(ios_base& str);
@@ -2624,6 +2632,10 @@
26242632

26252633
\rSec3[basefield.manip]{\tcode{basefield} manipulators}
26262634

2635+
\pnum
2636+
Each function specified in this subclause
2637+
is a designated addressable function\iref{namespace.std}.
2638+
26272639
\indexlibrary{\idxcode{dec}}%
26282640
\begin{itemdecl}
26292641
ios_base& dec(ios_base& str);
@@ -2682,6 +2694,10 @@
26822694

26832695
\rSec3[floatfield.manip]{\tcode{floatfield} manipulators}
26842696

2697+
\pnum
2698+
Each function specified in this subclause
2699+
is a designated addressable function\iref{namespace.std}.
2700+
26852701
\indexlibrary{\idxcode{fixed}}%
26862702
\begin{itemdecl}
26872703
ios_base& fixed(ios_base& str);
@@ -5526,6 +5542,10 @@
55265542

55275543
\rSec3[istream.manip]{Standard \tcode{basic_istream} manipulators}
55285544

5545+
\pnum
5546+
Each instantiation of this function template
5547+
is a designated addressable function\iref{namespace.std}.
5548+
55295549
\indexlibrary{\idxcode{ws}}%
55305550
\begin{itemdecl}
55315551
template<class charT, class traits>
@@ -6597,6 +6617,11 @@
65976617

65986618
\rSec3[ostream.manip]{Standard \tcode{basic_ostream} manipulators}
65996619

6620+
\pnum
6621+
Each instantiation of a function template
6622+
specified in this subclause
6623+
is a designated addressable function\iref{namespace.std}.
6624+
66006625
\indexlibrary{\idxcode{endl}}%
66016626
\begin{itemdecl}
66026627
template<class charT, class traits>

source/iterators.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,6 +3345,8 @@
33453345
headers are included: \tcode{<array>}, \tcode{<deque>}, \tcode{<forward_list>},
33463346
\tcode{<list>}, \tcode{<map>}, \tcode{<regex>}, \tcode{<set>}, \tcode{<string>},
33473347
\tcode{<string_view>}, \tcode{<unordered_map>}, \tcode{<unordered_set>}, and \tcode{<vector>}.
3348+
Each of these templates
3349+
is a designated customization point\iref{namespace.std}.
33483350

33493351
\indexlibrary{\idxcode{begin(C\&)}}%
33503352
\begin{itemdecl}
@@ -3482,6 +3484,8 @@
34823484
\tcode{<map>}, \tcode{<regex>}, \tcode{<set>}, \tcode{<string>},
34833485
\tcode{<string_view>},
34843486
\tcode{<unordered_map>}, \tcode{<unordered_set>}, and \tcode{<vector>}.
3487+
Each of these templates
3488+
is a designated customization point\iref{namespace.std}.
34853489

34863490
\indexlibrary{\idxcode{size(C\& c)}}%
34873491
\begin{itemdecl}

source/lib-intro.tex

Lines changed: 96 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,17 +2199,23 @@
21992199
\rSec4[namespace.std]{Namespace \tcode{std}}
22002200

22012201
\pnum
2202-
The behavior of a \Cpp{} program is undefined if it adds declarations or definitions to namespace
2202+
Unless otherwise specified,
2203+
the behavior of a \Cpp{} program is undefined if it adds declarations or definitions to namespace
22032204
\tcode{std}
22042205
or to a namespace within namespace
2205-
\tcode{std}
2206-
unless otherwise specified.
2207-
A program may add a template specialization for any standard library template
2206+
\tcode{std}.
2207+
2208+
\pnum
2209+
Unless explicitly prohibited,
2210+
a program may add a template specialization for
2211+
any standard library class template
22082212
to namespace
2209-
\tcode{std} only if the declaration
2210-
depends on a user-defined type
2211-
and the specialization meets the standard library requirements
2212-
for the original template and is not explicitly prohibited.\footnote{Any
2213+
\tcode{std} provided that
2214+
(a) the added declaration
2215+
depends on at least one user-defined type
2216+
and
2217+
(b) the specialization meets the standard library requirements
2218+
for the original template.\footnote{Any
22132219
library code that instantiates other library templates
22142220
must be prepared to work adequately with any user-supplied specialization
22152221
that meets the minimum requirements of this document.}
@@ -2234,11 +2240,90 @@
22342240

22352241
\item a deduction guide for any standard library class template.
22362242
\end{itemize}
2237-
A program may explicitly instantiate a template defined in the standard library
2238-
only if the declaration depends on the name of a user-defined type
2239-
and the instantiation meets the standard library requirements for the
2243+
2244+
\pnum
2245+
A program may explicitly instantiate
2246+
a class template defined in the standard library
2247+
only if the declaration
2248+
(a) depends on the name of at least one user-defined type
2249+
and
2250+
(b) the instantiation meets the standard library requirements for the
22402251
original template.
22412252

2253+
\pnum
2254+
Let \tcode{\placeholder{F}} denote
2255+
a standard library function\iref{global.functions},
2256+
a standard library static member function,
2257+
or an instantiation
2258+
of a standard library function template.
2259+
Unless \tcode{\placeholder{F}} is designated
2260+
an \defn{addressable function},
2261+
the behavior of a \Cpp{} program is unspecified (possibly ill-formed)
2262+
if it explicitly or implicitly attempts
2263+
to form a pointer
2264+
to \tcode{\placeholder{F}}.
2265+
\begin{note}
2266+
Possible means of forming such pointers include
2267+
application of the unary \tcode{\&} operator\iref{expr.unary.op},
2268+
\tcode{addressof}\iref{specialized.addressof},
2269+
or
2270+
a function-to-pointer standard conversion\iref{conv.func}.
2271+
\end{note}
2272+
Moreover,
2273+
the behavior of a \Cpp{} program is unspecified (possibly ill-formed)
2274+
if it attempts to form a reference
2275+
to \tcode{\placeholder{F}}
2276+
or
2277+
if it attempts to form a pointer-to-member designating
2278+
either a standard library non-static member function\iref{member.functions}
2279+
or an instantiation of a standard library member function template.
2280+
2281+
\pnum
2282+
Other than in namespace \tcode{std}
2283+
or in a namespace
2284+
within namespace \tcode{std},
2285+
a program may provide
2286+
an overload for any library function template
2287+
designated as a \defn{customization point},
2288+
provided that
2289+
(a)
2290+
the overload's declaration depends
2291+
on at least one user-defined type
2292+
and
2293+
(b)
2294+
the overload meets the standard library requirements
2295+
for the customization point.%
2296+
\footnote{
2297+
Any library customization point
2298+
must be prepared
2299+
to work adequately
2300+
with any user-defined overload
2301+
that meets the minimum requirements
2302+
of this document.
2303+
Therefore
2304+
an implementation may elect,
2305+
under the as-if rule\iref{intro.execution},
2306+
to provide any customization point
2307+
in the form
2308+
of an instantiated function object\iref{function.objects}
2309+
even though the customization point's specification
2310+
is in the form
2311+
of a function template.
2312+
The template parameters
2313+
of each such function object
2314+
and the function parameters
2315+
and return type
2316+
of the object's \tcode{operator()}
2317+
must match those
2318+
of the corresponding customization point's specification.}
2319+
\begin{note}
2320+
This permits
2321+
a (qualified or unqualified) call
2322+
to the customization point
2323+
to invoke the most appropriate overload
2324+
for the given arguments.
2325+
\end{note}
2326+
22422327
\pnum
22432328
A translation unit shall not declare namespace \tcode{std} to be an inline namespace\iref{namespace.def}.
22442329

source/std.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
%%--------------------------------------------------
7676
%% add special hyphenation rules
77-
\hyphenation{tem-plate ex-am-ple in-put-it-er-a-tor name-space name-spaces non-zero}
77+
\hyphenation{tem-plate ex-am-ple in-put-it-er-a-tor name-space name-spaces non-zero cus-tom-i-za-tion}
7878

7979
%%--------------------------------------------------
8080
%% turn off all ligatures inside \texttt

source/utilities.tex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@
200200

201201
\begin{itemdescr}
202202
\pnum
203-
\remarks This function shall not participate in overload resolution
203+
\remarks This function
204+
is a designated customization point\iref{namespace.std} and
205+
shall not participate in overload resolution
204206
unless \tcode{is_move_constructible_v<T>} is \tcode{true} and
205207
\tcode{is_move_assignable_v<T>} is \tcode{true}.
206208
The expression inside \tcode{noexcept} is equivalent to:

0 commit comments

Comments
 (0)