|
97 | 97 |
|
98 | 98 | \pnum
|
99 | 99 | A \defnadj{local}{entity} is a variable with
|
100 |
| -automatic storage duration\iref{basic.stc.auto}, |
101 |
| -a structured binding\iref{dcl.struct.bind} |
| 100 | +\link{automatic storage duration}{basic.stc.auto}, |
| 101 | +a \link{structured binding}{dcl.struct.bind} |
102 | 102 | whose corresponding variable is such an entity,
|
103 | 103 | or the \tcode{*\keyword{this}} object\iref{expr.prim.this}.
|
104 | 104 |
|
|
128 | 128 | \indextext{linkage}%
|
129 | 129 | A name used in more than one translation unit can potentially
|
130 | 130 | refer to the same entity in these translation units depending on the
|
131 |
| -linkage\iref{basic.link} of the name specified in each |
| 131 | +\link{linkage}{basic.link} of the name specified in each |
132 | 132 | translation unit.
|
133 | 133 |
|
134 | 134 | \rSec1[basic.def]{Declarations and definitions}
|
|
137 | 137 | \indextext{declaration!definition versus}%
|
138 | 138 | \indextext{declaration}%
|
139 | 139 | \indextext{declaration!name}%
|
140 |
| -A declaration\iref{dcl.dcl} may (re)introduce |
| 140 | +A \link{declaration}{dcl.dcl} may (re)introduce |
141 | 141 | one or more names and/or entities into a translation
|
142 | 142 | unit.
|
143 | 143 | If so, the
|
|
150 | 150 | \item a static assertion\iref{dcl.pre},
|
151 | 151 | \item controlling template instantiation\iref{temp.explicit},
|
152 | 152 | \item guiding template argument deduction for constructors\iref{temp.deduct.guide},
|
153 |
| -\item use of attributes\iref{dcl.attr}, and |
| 153 | +\item use of \link{attributes}{dcl.attr}, and |
154 | 154 | \item nothing (in the case of an \grammarterm{empty-declaration}).
|
155 | 155 | \end{itemize}
|
156 | 156 |
|
|
234 | 234 | \item it is
|
235 | 235 | an explicit instantiation declaration\iref{temp.explicit}, or
|
236 | 236 | \item it is
|
237 |
| -an explicit specialization\iref{temp.expl.spec} whose |
| 237 | +an \link{explicit specialization}{temp.expl.spec} whose |
238 | 238 | \grammarterm{declaration} is not a definition.
|
239 | 239 | \end{itemize}
|
240 | 240 | A declaration is said to be a \defn{definition} of each entity that it defines.
|
|
276 | 276 | default constructor\iref{class.default.ctor},
|
277 | 277 | copy constructor, move constructor\iref{class.copy.ctor},
|
278 | 278 | copy assignment operator, move assignment operator\iref{class.copy.assign},
|
279 |
| -or destructor\iref{class.dtor} member functions. |
| 279 | +or \link{destructor}{class.dtor} member functions. |
280 | 280 | \end{note}
|
281 | 281 | \begin{example}
|
282 | 282 | Given
|
|
360 | 360 | \item If $E$ is an
|
361 | 361 | \grammarterm{id-expression}\iref{expr.prim.id}, the set
|
362 | 362 | contains only $E$.
|
363 |
| -\item If $E$ is a subscripting operation\iref{expr.sub} with |
| 363 | +\item If $E$ is a \link{subscripting}{expr.sub} operation with |
364 | 364 | an array operand, the set contains the potential results of that operand.
|
365 | 365 | \item If $E$ is a class member access
|
366 | 366 | expression\iref{expr.ref} of the form
|
|
370 | 370 | \item If $E$ is a class member access expression
|
371 | 371 | naming a static data member,
|
372 | 372 | the set contains the \grammarterm{id-expression} designating the data member.
|
373 |
| -\item If $E$ is a pointer-to-member |
374 |
| -expression\iref{expr.mptr.oper} of the form |
| 373 | +\item If $E$ is a \link{pointer-to-member expression}{expr.mptr.oper} of the form |
375 | 374 | $E_1$ \tcode{.*} $E_2$,
|
376 | 375 | the set contains the potential results of $E_1$.
|
377 | 376 | \item If $E$ has the form \tcode{($E_1$)}, the set contains the
|
378 | 377 | potential results of $E_1$.
|
379 |
| -\item If $E$ is a glvalue conditional |
380 |
| -expression\iref{expr.cond}, the set is the union of the sets of |
| 378 | +\item If $E$ is a glvalue \link{conditional expression}{expr.cond}, |
| 379 | +the set is the union of the sets of |
381 | 380 | potential results of the second and third operands.
|
382 |
| -\item If $E$ is a comma expression\iref{expr.comma}, the set |
| 381 | +\item If $E$ is a \link{comma expression}{expr.comma}, the set |
383 | 382 | contains the potential results of the right operand.
|
384 | 383 | \item Otherwise, the set is empty.
|
385 | 384 | \end{itemize}
|
|
529 | 528 | copy assignment or move assignment function for another class as specified
|
530 | 529 | in~\ref{class.copy.assign}.
|
531 | 530 | A constructor for a class is odr-used as specified
|
532 |
| -in~\ref{dcl.init}. A destructor for a class is odr-used if it is potentially |
533 |
| -invoked\iref{class.dtor}. |
| 531 | +in~\ref{dcl.init}. A destructor for a class is odr-used if it is |
| 532 | +\deflink{potentially invoked}{class.dtor}. |
534 | 533 |
|
535 | 534 | \pnum
|
536 | 535 | A local entity\iref{basic.pre}
|
|
601 | 600 | \pnum
|
602 | 601 | Every program shall contain at least one definition of every
|
603 | 602 | function or variable that is odr-used in that program
|
604 |
| -outside of a discarded statement\iref{stmt.if}; no diagnostic required. |
| 603 | +outside of a \deflink{discarded statement}{stmt.if}; no diagnostic required. |
605 | 604 | The definition can appear explicitly in the program, it can be found in
|
606 | 605 | the standard or a user-defined library, or (when appropriate) it is
|
607 | 606 | implicitly defined (see~\ref{class.default.ctor}, \ref{class.copy.ctor},
|
|
649 | 648 | describe in which contexts complete class types are required. A class
|
650 | 649 | type \tcode{T} must be complete if
|
651 | 650 | \begin{itemize}
|
652 |
| -\item an object of type \tcode{T} is defined\iref{basic.def}, or |
653 |
| -\item a non-static class data member of type \tcode{T} is |
654 |
| -declared\iref{class.mem}, or |
| 651 | +\item an object of type \tcode{T} is \link{defined}{basic.def}, or |
| 652 | +\item a non-static class \deflink{data member}{class.mem} of |
| 653 | +type \tcode{T} is declared, or |
655 | 654 | \item \tcode{T} is used as the allocated type or array element type in a
|
656 | 655 | \grammarterm{new-expression}\iref{expr.new}, or
|
657 | 656 | \item an lvalue-to-rvalue conversion is applied to
|
|
671 | 670 | \keyword{sizeof} operator\iref{expr.sizeof} is applied to an operand of
|
672 | 671 | type \tcode{T}, or
|
673 | 672 | \item a function with a return type or argument type of type \tcode{T}
|
674 |
| -is defined\iref{basic.def} or called\iref{expr.call}, or |
| 673 | +is defined\iref{basic.def} or \link{called}{expr.call}, or |
675 | 674 | \item a class with a base class of type \tcode{T} is
|
676 | 675 | defined\iref{class.derived}, or
|
677 |
| -\item an lvalue of type \tcode{T} is assigned to\iref{expr.ass}, or |
| 676 | +\item an lvalue of type \tcode{T} is \link{assigned to}{expr.ass}, or |
678 | 677 | \item the type \tcode{T} is the subject of an
|
679 | 678 | \keyword{alignof} expression\iref{expr.alignof}, or
|
680 | 679 | \item an \grammarterm{exception-declaration} has type \tcode{T}, reference to
|
|
717 | 716 | a non-volatile const object with internal or no linkage if the object
|
718 | 717 | \begin{itemize}
|
719 | 718 | \item has the same literal type in all definitions of \tcode{D},
|
720 |
| -\item is initialized with a constant expression\iref{expr.const}, |
| 719 | +\item is initialized with a \link{constant expression}{expr.const}, |
721 | 720 | \item is not odr-used in any definition of \tcode{D}, and
|
722 | 721 | \item has the same value in all definitions of \tcode{D},
|
723 | 722 | \end{itemize}
|
|
2691 | 2690 |
|
2692 | 2691 | \pnum
|
2693 | 2692 | \indextext{program}%
|
2694 |
| -A \defn{program} consists of one or more translation units\iref{lex.separate} |
| 2693 | +A \defn{program} consists of one or more \deflinkx{translation units}{translation unit}{lex.separate} |
2695 | 2694 | linked together. A translation unit consists
|
2696 | 2695 | of a sequence of declarations.
|
2697 | 2696 |
|
|
2724 | 2723 | \indextext{linkage!\idxcode{inline} and}%
|
2725 | 2724 | \indextext{\idxcode{inline}!linkage of}%
|
2726 | 2725 | The name of an entity
|
2727 |
| -that belongs to a namespace scope\iref{basic.scope.namespace} |
| 2726 | +that belongs to a \link{namespace scope}{basic.scope.namespace} |
2728 | 2727 | has internal linkage if it is the name of
|
2729 | 2728 | \begin{itemize}
|
2730 | 2729 | \item
|
|
2765 | 2764 | purposes\iref{dcl.typedef}; or
|
2766 | 2765 | \item
|
2767 | 2766 | \indextext{enumeration!linkage of}%
|
2768 |
| -a named enumeration\iref{dcl.enum}, or an unnamed enumeration defined |
| 2767 | +a named \link{enumeration}{dcl.enum}, or an unnamed enumeration defined |
2769 | 2768 | in a typedef declaration in which the enumeration has the typedef name
|
2770 | 2769 | for linkage purposes\iref{dcl.typedef}; or
|
2771 | 2770 | \item an unnamed enumeration
|
|
2841 | 2840 | \pnum
|
2842 | 2841 | \indextext{linkage!no}%
|
2843 | 2842 | Names not covered by these rules have no linkage. Moreover, except as
|
2844 |
| -noted, a name declared at block scope\iref{basic.scope.block} has no |
| 2843 | +noted, a name declared at \deflinkx{block scope}{scope!block}{basic.scope.block} has no |
2845 | 2844 | linkage.
|
2846 | 2845 |
|
2847 | 2846 | \pnum
|
|
3163 | 3162 | involve additional memory locations that are not accessible to programs but are
|
3164 | 3163 | managed by the implementation.
|
3165 | 3164 | \end{note}
|
3166 |
| -Two or more threads of |
3167 |
| -execution\iref{intro.multithread} can access separate memory |
| 3165 | +Two or more \deflinkx{threads of |
| 3166 | +execution}{thread of execution}{intro.multithread} can access separate memory |
3168 | 3167 | locations without interfering with each other.
|
3169 | 3168 |
|
3170 | 3169 | \pnum
|
|
3208 | 3207 | The constructs in a \Cpp{} program create, destroy, refer to, access, and
|
3209 | 3208 | manipulate objects.
|
3210 | 3209 | An \defn{object} is created
|
3211 |
| -by a definition\iref{basic.def}, |
| 3210 | +by a \link{definition}{basic.def}, |
3212 | 3211 | by a \grammarterm{new-expression}\iref{expr.new},
|
3213 | 3212 | by an operation that implicitly creates objects (see below),
|
3214 |
| -when implicitly changing the active member of a union\iref{class.union}, |
| 3213 | +when implicitly changing the active member of a \link{union}{class.union}, |
3215 | 3214 | or
|
3216 | 3215 | when a temporary object is created\iref{conv.rval,class.temporary}.
|
3217 | 3216 | An object occupies a region of storage
|
3218 | 3217 | in its period of construction\iref{class.cdtor},
|
3219 |
| -throughout its lifetime\iref{basic.life}, |
| 3218 | +throughout its \link{lifetime}{basic.life}, |
3220 | 3219 | and
|
3221 | 3220 | in its period of destruction\iref{class.cdtor}.
|
3222 | 3221 | \begin{note}
|
|
3346 | 3345 | \begin{itemize}
|
3347 | 3346 | \item a base class subobject, or
|
3348 | 3347 | \item a non-static data member
|
3349 |
| -declared with the \tcode{no_unique_address} attribute\iref{dcl.attr.nouniqueaddr}. |
| 3348 | +declared with the \link{\tcode{no_unique_address}}{dcl.attr.nouniqueaddr} attribute. |
3350 | 3349 | \end{itemize}
|
3351 | 3350 |
|
3352 | 3351 | \pnum
|
|
3367 | 3366 | are \impldef{which non-standard-layout objects
|
3368 | 3367 | containing no data are considered empty}.
|
3369 | 3368 | \indextext{most derived object!bit-field}%
|
3370 |
| -Unless it is a bit-field\iref{class.bit}, |
| 3369 | +Unless it is a \link{bit-field}{class.bit}, |
3371 | 3370 | an object with nonzero size
|
3372 | 3371 | shall occupy one or more bytes of storage,
|
3373 | 3372 | including every byte that is occupied in full or in part
|
|
3932 | 3931 | is produced by the evaluation of:
|
3933 | 3932 | \begin{itemize}
|
3934 | 3933 | \item
|
3935 |
| - the second or third operand of a conditional expression\iref{expr.cond}, |
| 3934 | + the second or third operand of a \link{conditional expression}{expr.cond}, |
3936 | 3935 | \item
|
3937 |
| - the right operand of a comma expression\iref{expr.comma}, |
| 3936 | + the right operand of a \link{comma expression}{expr.comma}, |
3938 | 3937 | \item
|
3939 | 3938 | the operand of a cast or conversion\iref{conv.integral,
|
3940 | 3939 | expr.type.conv,expr.static.cast,expr.cast}
|
3941 | 3940 | to an unsigned ordinary character type
|
3942 | 3941 | or \tcode{std::byte} type\iref{cstddef.syn}, or
|
3943 | 3942 | \item
|
3944 |
| - a discarded-value expression\iref{expr.context}, |
| 3943 | + a \deflink{discarded-value expression}{expr.context}, |
3945 | 3944 | \end{itemize}
|
3946 | 3945 | then the result of the operation is an indeterminate value or
|
3947 | 3946 | that erroneous value, respectively.
|
|
4132 | 4131 | \indextext{storage duration!dynamic|(}
|
4133 | 4132 |
|
4134 | 4133 | \pnum
|
4135 |
| -Objects can be created dynamically during program |
4136 |
| -execution\iref{intro.execution}, using |
| 4134 | +Objects can be created dynamically during \link{program |
| 4135 | +execution}{intro.execution}, using |
4137 | 4136 | \indextext{\idxcode{new}}%
|
4138 | 4137 | \grammarterm{new-expression}{s}\iref{expr.new}, and destroyed using
|
4139 | 4138 | \indextext{\idxcode{delete}}%
|
|
4302 | 4301 | \tcode{std::bad_alloc}\iref{bad.alloc}.
|
4303 | 4302 |
|
4304 | 4303 | \pnum
|
4305 |
| -A global allocation function is only called as the result of a new |
4306 |
| -expression\iref{expr.new}, or called directly using the function call |
4307 |
| -syntax\iref{expr.call}, or called indirectly to allocate storage for |
| 4304 | +A global allocation function is only called as the result of a \link{new |
| 4305 | +expression}{expr.new}, or called directly using the \link{function call}{expr.call} |
| 4306 | +syntax, or called indirectly to allocate storage for |
4308 | 4307 | a coroutine state\iref{dcl.fct.def.coroutine},
|
4309 | 4308 | or called indirectly through calls to the
|
4310 | 4309 | functions in the \Cpp{} standard library.
|
4311 | 4310 | \begin{note}
|
4312 | 4311 | In particular, a
|
4313 | 4312 | global allocation function is not called to allocate storage for objects
|
4314 |
| -with static storage duration\iref{basic.stc.static}, for objects or references |
4315 |
| -with thread storage duration\iref{basic.stc.thread}, for objects of |
4316 |
| -type \tcode{std::type_info}\iref{expr.typeid}, or for an |
4317 |
| -exception object\iref{except.throw}. |
| 4313 | +with \link{static storage duration}{basic.stc.static}, for objects or references |
| 4314 | +with \link{thread storage duration}{basic.stc.thread}, for objects of |
| 4315 | +type \link{\tcode{std::type_info}}{expr.typeid}, or for an |
| 4316 | +\link{exception object}{except.throw}. |
4318 | 4317 | \end{note}
|
4319 | 4318 |
|
4320 | 4319 | \rSec4[basic.stc.dynamic.deallocation]{Deallocation functions}
|
|
4778 | 4777 | impose requirements on implementations regarding the representation
|
4779 | 4778 | of types.
|
4780 | 4779 | There are two kinds of types: fundamental types and compound types.
|
4781 |
| -Types describe objects\iref{intro.object}, |
4782 |
| -references\iref{dcl.ref}, |
4783 |
| -or functions\iref{dcl.fct}. |
| 4780 | +Types describe \link{objects}{intro.object}, |
| 4781 | +\link{references}{dcl.ref}, |
| 4782 | +or \link{functions}{dcl.fct}. |
4784 | 4783 | \end{note}
|
4785 | 4784 |
|
4786 | 4785 | \pnum
|
|
4954 | 4953 | pointer types, pointer-to-member types\iref{basic.compound},
|
4955 | 4954 | \tcode{std::nullptr_t},
|
4956 | 4955 | and
|
4957 |
| -cv-qualified\iref{basic.type.qualifier} versions of these |
| 4956 | +\link{cv-qualified}{basic.type.qualifier} versions of these |
4958 | 4957 | types are collectively called
|
4959 | 4958 | \defnadjx{scalar}{types}{type}.
|
4960 | 4959 | \label{term.trivially.copyable.type}%
|
|
4979 | 4978 | \item a scalar type; or
|
4980 | 4979 | \item a reference type; or
|
4981 | 4980 | \item an array of literal type; or
|
4982 |
| -\item a possibly cv-qualified class type\iref{class} that |
| 4981 | +\item a possibly cv-qualified \link{class type}{class} that |
4983 | 4982 | has all of the following properties:
|
4984 | 4983 | \begin{itemize}
|
4985 | 4984 | \item it has a constexpr destructor\iref{dcl.constexpr},
|
|
5013 | 5012 | Two types \cvqual{cv1} \tcode{T1} and \cvqual{cv2} \tcode{T2} are
|
5014 | 5013 | \defnadjx{layout-compatible}{types}{type}
|
5015 | 5014 | if \tcode{T1} and \tcode{T2} are the same type,
|
5016 |
| -layout-compatible enumerations\iref{dcl.enum}, or |
5017 |
| -layout-compatible standard-layout class types\iref{class.mem}. |
| 5015 | +\deflinkx{layout-compatible enumerations}{layout-compatible!enumeration}{dcl.enum}, or |
| 5016 | +\deflinkx{layout-compatible standard-layout class types}{layout-compatible!class}{class.mem}. |
5018 | 5017 |
|
5019 | 5018 | \rSec2[basic.fundamental]{Fundamental types}
|
5020 | 5019 |
|
|
5462 | 5461 | which identify members of a given
|
5463 | 5462 | type within objects of a given class, \ref{dcl.mptr}.
|
5464 | 5463 | Pointers to data members and pointers to member functions are collectively
|
5465 |
| -called \term{pointer-to-member} types. |
| 5464 | +called \defn{pointer-to-member} types. |
5466 | 5465 | \end{itemize}
|
5467 | 5466 |
|
5468 | 5467 | \pnum
|
|
5540 | 5539 | have the same value representation and alignment
|
5541 | 5540 | requirements\iref{basic.align}.
|
5542 | 5541 | \begin{note}
|
5543 |
| -Pointers to over-aligned types\iref{basic.align} have no special |
| 5542 | +Pointers to \deflinkx{over-aligned types}{type!over-aligned}{basic.align} have no special |
5544 | 5543 | representation, but their range of valid values is restricted by the extended
|
5545 | 5544 | alignment requirement.
|
5546 | 5545 | \end{note}
|
|
5855 | 5854 | \indextext{program execution|(}
|
5856 | 5855 |
|
5857 | 5856 | \pnum
|
5858 |
| -An instance of each object with automatic storage |
5859 |
| -duration\iref{basic.stc.auto} is associated with each entry into its |
| 5857 | +An instance of each object with \link{automatic storage |
| 5858 | +duration}{basic.stc.auto} is associated with each entry into its |
5860 | 5859 | block. Such an object exists and retains its last-stored value during
|
5861 | 5860 | the execution of the block and while the block is suspended (by a call
|
5862 | 5861 | of a function, suspension of a coroutine\iref{expr.await}, or receipt of a signal).
|
|
5901 | 5900 | the initialization of the entities captured by copy and
|
5902 | 5901 | the constituent expressions of the \grammarterm{initializer} of the \grammarterm{init-capture}{s},
|
5903 | 5902 | \item
|
5904 |
| -if $E$ is a function call\iref{expr.call} or implicitly invokes a function, |
| 5903 | +if $E$ is a \link{function call}{expr.call} or implicitly invokes a function, |
5905 | 5904 | the constituent expressions of each default argument\iref{dcl.fct.default}
|
5906 | 5905 | used in the call, or
|
5907 | 5906 | \item
|
|
5932 | 5931 | A \defn{full-expression} is
|
5933 | 5932 | \begin{itemize}
|
5934 | 5933 | \item
|
5935 |
| -an unevaluated operand\iref{expr.context}, |
| 5934 | +an \deflink{unevaluated operand}{expr.context}, |
5936 | 5935 | \item
|
5937 | 5936 | a \grammarterm{constant-expression}\iref{expr.const},
|
5938 | 5937 | \item
|
|
0 commit comments