|
4 | 4 | \gramSec[gram.basic]{Basic concepts}
|
5 | 5 |
|
6 | 6 | \pnum
|
7 |
| -\begin{note} This Clause presents the basic concepts of the \Cpp language. |
| 7 | +\begin{note} This Clause presents the basic concepts of the \Cpp{} language. |
8 | 8 | It explains the difference between an object and a
|
9 | 9 | name and how they relate to the value categories for expressions.
|
10 | 10 | It introduces the concepts of a
|
11 |
| -declaration and a definition and presents \Cpp's |
| 11 | +declaration and a definition and presents \Cpp{}'s |
12 | 12 | notion of type, scope, linkage, and
|
13 | 13 | storage duration. The mechanisms for starting and
|
14 | 14 | terminating a program are discussed. Finally, this Clause presents the
|
|
215 | 215 | \pnum
|
216 | 216 | \begin{note}
|
217 | 217 | \indextext{implementation-generated}%
|
218 |
| -In some circumstances, \Cpp implementations implicitly define the |
| 218 | +In some circumstances, \Cpp{} implementations implicitly define the |
219 | 219 | default constructor\iref{class.ctor},
|
220 | 220 | copy constructor\iref{class.copy},
|
221 | 221 | move constructor\iref{class.copy},
|
|
2540 | 2540 | identity does not require a diagnostic.
|
2541 | 2541 |
|
2542 | 2542 | \pnum
|
2543 |
| -\begin{note} Linkage to non-\Cpp declarations can be achieved using a |
| 2543 | +\begin{note} Linkage to non-\Cpp{} declarations can be achieved using a |
2544 | 2544 | \grammarterm{linkage-specification}\iref{dcl.link}. \end{note}%
|
2545 | 2545 | \indextext{linkage|)}
|
2546 | 2546 |
|
|
2550 | 2550 |
|
2551 | 2551 | \pnum
|
2552 | 2552 | \indextext{memory model|(}%
|
2553 |
| -The fundamental storage unit in the \Cpp memory model is the |
| 2553 | +The fundamental storage unit in the \Cpp{} memory model is the |
2554 | 2554 | \defn{byte}.
|
2555 | 2555 | A byte is at least large enough to contain any member of the basic
|
2556 | 2556 | \indextext{character set!basic execution}%
|
|
2562 | 2562 | the number of which is \impldef{bits in a byte}. The least
|
2563 | 2563 | significant bit is called the \defn{low-order bit}; the most
|
2564 | 2564 | significant bit is called the \defn{high-order bit}. The memory
|
2565 |
| -available to a \Cpp program consists of one or more sequences of |
| 2565 | +available to a \Cpp{} program consists of one or more sequences of |
2566 | 2566 | contiguous bytes. Every byte has a unique address.
|
2567 | 2567 |
|
2568 | 2568 | \pnum
|
|
2614 | 2614 |
|
2615 | 2615 | \pnum
|
2616 | 2616 | \indextext{object model|(}%
|
2617 |
| -The constructs in a \Cpp program create, destroy, refer to, access, and |
| 2617 | +The constructs in a \Cpp{} program create, destroy, refer to, access, and |
2618 | 2618 | manipulate objects.
|
2619 | 2619 | An \defn{object} is created
|
2620 | 2620 | by a definition\iref{basic.def},
|
|
2800 | 2800 |
|
2801 | 2801 | \pnum
|
2802 | 2802 | \begin{note}
|
2803 |
| -\Cpp provides a variety of fundamental types and several ways of composing |
| 2803 | +\Cpp{} provides a variety of fundamental types and several ways of composing |
2804 | 2804 | new types from existing types\iref{basic.types}.
|
2805 | 2805 | \end{note}%
|
2806 | 2806 | \indextext{object model|)}
|
|
3181 | 3181 | \indextext{\idxcode{new}}%
|
3182 | 3182 | \grammarterm{new-expression}{s}\iref{expr.new}, and destroyed using
|
3183 | 3183 | \indextext{\idxcode{delete}}%
|
3184 |
| -\grammarterm{delete-expression}{s}\iref{expr.delete}. A \Cpp implementation |
| 3184 | +\grammarterm{delete-expression}{s}\iref{expr.delete}. A \Cpp{} implementation |
3185 | 3185 | provides access to, and management of, dynamic storage via the global
|
3186 | 3186 | \defn{allocation functions} \tcode{operator new} and \tcode{operator
|
3187 | 3187 | new[]} and the global \defn{deallocation functions} \tcode{operator
|
|
3194 | 3194 | \pnum
|
3195 | 3195 | The library provides default definitions for the global allocation and
|
3196 | 3196 | deallocation functions. Some global allocation and deallocation
|
3197 |
| -functions are replaceable\iref{new.delete}. A \Cpp program shall |
| 3197 | +functions are replaceable\iref{new.delete}. A \Cpp{} program shall |
3198 | 3198 | provide at most one definition of a replaceable allocation or
|
3199 | 3199 | deallocation function. Any such function definition replaces the default
|
3200 | 3200 | version provided in the library\iref{replacement.functions}. The
|
|
3240 | 3240 | class\iref{class.free}.
|
3241 | 3241 |
|
3242 | 3242 | \pnum
|
3243 |
| -Any allocation and/or deallocation functions defined in a \Cpp program, |
| 3243 | +Any allocation and/or deallocation functions defined in a \Cpp{} program, |
3244 | 3244 | including the default versions in the library, shall conform to the
|
3245 | 3245 | semantics specified in~\ref{basic.stc.dynamic.allocation}
|
3246 | 3246 | and~\ref{basic.stc.dynamic.deallocation}.
|
|
3288 | 3288 | returned as a request for zero size is undefined.\footnote{The intent is
|
3289 | 3289 | to have \tcode{operator new()} implementable by
|
3290 | 3290 | calling \tcode{std::malloc()} or \tcode{std::calloc()}, so the rules are
|
3291 |
| -substantially the same. \Cpp differs from C in requiring a zero request |
| 3291 | +substantially the same. \Cpp{} differs from C in requiring a zero request |
3292 | 3292 | to return a non-null pointer.}
|
3293 | 3293 |
|
3294 | 3294 | \pnum
|
|
3311 | 3311 | A global allocation function is only called as the result of a new
|
3312 | 3312 | expression\iref{expr.new}, or called directly using the function call
|
3313 | 3313 | syntax\iref{expr.call}, or called indirectly through calls to the
|
3314 |
| -functions in the \Cpp standard library. \begin{note} In particular, a |
| 3314 | +functions in the \Cpp{} standard library. \begin{note} In particular, a |
3315 | 3315 | global allocation function is not called to allocate storage for objects
|
3316 | 3316 | with static storage duration\iref{basic.stc.static}, for objects or references
|
3317 | 3317 | with thread storage duration\iref{basic.stc.thread}, for objects of
|
|
3394 | 3394 | A pointer value is a \defn{safely-derived pointer} to a dynamic object only if it
|
3395 | 3395 | has an object pointer type and it is one of the following:
|
3396 | 3396 | \begin{itemize}
|
3397 |
| -\item the value returned by a call to the \Cpp standard library implementation of |
| 3397 | +\item the value returned by a call to the \Cpp{} standard library implementation of |
3398 | 3398 | \tcode{::operator new(std::\brk{}size_t)} or
|
3399 | 3399 | \tcode{::operator new(std::size_t, std::align_val_t)}%
|
3400 | 3400 | ;\footnote{This subclause does not impose restrictions
|
3401 | 3401 | on indirection through pointers to memory not allocated by \tcode{::operator new}. This
|
3402 |
| -maintains the ability of many \Cpp implementations to use binary libraries and |
| 3402 | +maintains the ability of many \Cpp{} implementations to use binary libraries and |
3403 | 3403 | components written in other languages. In particular, this applies to C binaries,
|
3404 | 3404 | because indirection through pointers to memory allocated by \tcode{std::malloc} is not restricted.}
|
3405 | 3405 |
|
|
3636 | 3636 | a set of bits in the object representation that determines a
|
3637 | 3637 | \defn{value}, which is one discrete element of an
|
3638 | 3638 | \impldef{values of a trivially copyable type} set of values.\footnote{The
|
3639 |
| -intent is that the memory model of \Cpp is compatible |
| 3639 | +intent is that the memory model of \Cpp{} is compatible |
3640 | 3640 | with that of ISO/IEC 9899 Programming Language C.}
|
3641 | 3641 |
|
3642 | 3642 | \pnum
|
|
4556 | 4556 | If \placeholder{A} and \placeholder{B} would not otherwise be sequenced then they are
|
4557 | 4557 | indeterminately sequenced.
|
4558 | 4558 | \end{note}
|
4559 |
| -Several contexts in \Cpp cause evaluation of a function call, even |
| 4559 | +Several contexts in \Cpp{} cause evaluation of a function call, even |
4560 | 4560 | though no corresponding function call syntax appears in the translation
|
4561 | 4561 | unit.
|
4562 | 4562 | \begin{example}
|
|
4596 | 4596 | with automatic or thread storage duration\iref{basic.stc} is associated with
|
4597 | 4597 | one specific thread, and can be accessed by a different thread only indirectly
|
4598 | 4598 | through a pointer or reference\iref{basic.compound}.} Under a hosted
|
4599 |
| -implementation, a \Cpp program can have more than one thread running |
| 4599 | +implementation, a \Cpp{} program can have more than one thread running |
4600 | 4600 | concurrently. The execution of each thread proceeds as defined by the remainder
|
4601 | 4601 | of this document. The execution of the entire program consists of an execution
|
4602 | 4602 | of all of its threads. \begin{note} Usually the execution can be viewed as an
|
|
4878 | 4878 | \begin{note} The four preceding coherence requirements effectively disallow
|
4879 | 4879 | compiler reordering of atomic operations to a single object, even if both
|
4880 | 4880 | operations are relaxed loads. This effectively makes the cache coherence
|
4881 |
| -guarantee provided by most hardware available to \Cpp atomic operations. |
| 4881 | +guarantee provided by most hardware available to \Cpp{} atomic operations. |
4882 | 4882 | \end{note}
|
4883 | 4883 |
|
4884 | 4884 | \pnum
|
|
4942 | 4942 |
|
4943 | 4943 | \pnum
|
4944 | 4944 | \begin{note} Transformations that introduce a speculative read of a potentially
|
4945 |
| -shared memory location may not preserve the semantics of the \Cpp program as |
| 4945 | +shared memory location may not preserve the semantics of the \Cpp{} program as |
4946 | 4946 | defined in this document, since they potentially introduce a data race. However,
|
4947 | 4947 | they are typically valid in the context of an optimizing compiler that targets a
|
4948 | 4948 | specific machine with well-defined semantics for data races. They would be
|
|
5174 | 5174 |
|
5175 | 5175 | \pnum
|
5176 | 5176 | An implementation shall not predefine the \tcode{main} function. This
|
5177 |
| -function shall not be overloaded. Its type shall have \Cpp language linkage |
| 5177 | +function shall not be overloaded. Its type shall have \Cpp{} language linkage |
5178 | 5178 | and it shall have a declared return type of type
|
5179 | 5179 | \tcode{int}, but otherwise its type is \impldef{parameters to \tcode{main}}.
|
5180 | 5180 | \indextext{\idxcode{main} function!implementation-defined parameters to}%
|
|
0 commit comments