You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any *postfix-expression* is considered a *unary-expression*, and because any primary expression is considered a *postfix-expression*, any primary expressions is considered a *unary-expression* also. For more information, see [Postfix Expressions](../cpp/postfix-expressions.md) and [Primary Expressions](../cpp/primary-expressions.md).
59
+
## Remarks
63
60
64
-
A *unary-operator* consists of one or more of the following symbols: `* & + - ! ~`
61
+
Any *`postfix-expression`* is considered a *`unary-expression`*, and because any *`primary-expression`* is considered a *`postfix-expression`*, any *`primary-expression`* is considered a *`unary-expression`* also. For more information, see [Postfix expressions](../cpp/postfix-expressions.md) and [Primary expressions](../cpp/primary-expressions.md).
65
62
66
-
The *cast-expression* is a unaryexpression with an optional cast to change the type. For more information see [Cast Operator: ()](../cpp/cast-operator-parens.md).
63
+
The *`cast-expression`* is a *`unary-expression`* with an optional cast to change the type. For more information, see [Cast operator: `()`](../cpp/cast-operator-parens.md).
67
64
68
-
An *expression* can be any expression. For more information, see [Expressions](../cpp/expressions-cpp.md).
65
+
The *`noexcept-expression`* is a *`noexcept-specifier`* with a *`constant-expression`* argument. For more information, see [`noexcept`](../cpp/noexcept-cpp.md).
69
66
70
-
The *allocation-expression* refers to the **`new`** operator. The *deallocation-expression* refers to the **`delete`** operator. For more information, see the links earlier in this topic.
67
+
The *`new-expression`* refers to the **`new`** operator. The *`delete-expression`* refers to the **`delete`** operator. For more information, see [`new` operator](../cpp/new-operator-cpp.md) and [`delete` operator](../cpp/delete-operator-cpp.md).
71
68
72
69
## See also
73
70
74
-
[Types of Expressions](../cpp/types-of-expressions.md)
71
+
[Types of expressions](../cpp/types-of-expressions.md)
A constant expression of type **`bool`** that represents whether the set of potential exception types is empty. The unconditional version is equivalent to `noexcept(true)`.
22
25
23
26
## Remarks
24
27
25
-
A *noexceptexpression* is a kind of *exception specification*, a suffix to a function declaration that represents a set of types that might be matched by an exception handler for any exception that exits a function. Unary conditional operator `noexcept(`*constant_expression*`)`where *constant_expression* yields **`true`**, and its unconditional synonym **`noexcept`**, specify that the set of potential exception types that can exit a function is empty. That is, the function never throws an exception and never allows an exception to be propagated outside its scope. The operator `noexcept(`*constant_expression*`)`where *constant_expression* yields **`false`**, or the absence of an exception specification (other than for a destructor or deallocation function), indicates that the set of potential exceptions that can exit the function is the set of all types.
28
+
A *`noexcept-expression`* is a kind of *exception specification*: a suffix to a function declaration that represents a set of types that might be matched by an exception handler for any exception that exits a function. Unary conditional operator `noexcept(constant_expression)`when *`constant_expression`* yields **`true`**, and its unconditional synonym **`noexcept`**, specify that the set of potential exception types that can exit a function is empty. That is, the function never throws an exception and never allows an exception to be propagated outside its scope. The operator `noexcept(constant_expression)`when *`constant_expression`* yields **`false`**, or the absence of an exception specification (other than for a destructor or deallocation function), indicates that the set of potential exceptions that can exit the function is the set of all types.
26
29
27
-
Mark a function as **`noexcept`** only if all the functions that it calls, either directly or indirectly, are also **`noexcept`** or **`const`**. The compiler does not necessarily check every code path for exceptions that might bubble up to a **`noexcept`** function. If an exception does exit the outer scope of a function marked **`noexcept`**, [std::terminate](../standard-library/exception-functions.md#terminate) is invoked immediately, and there is no guarantee that destructors of any in-scope objects will be invoked. Use **`noexcept`** instead of the dynamic exception specifier `throw()`, which is now deprecated in the standard. We recommended you apply **`noexcept`** to any function that never allows an exception to propagate up the call stack. When a function is declared **`noexcept`**, it enables the compiler to generate more efficient code in several different contexts. For more information, see [Exception specifications](exception-specifications-throw-cpp.md).
30
+
Mark a function as **`noexcept`** only if all the functions that it calls, either directly or indirectly, are also **`noexcept`** or **`const`**. The compiler doesn't necessarily check every code path for exceptions that might bubble up to a **`noexcept`** function. If an exception does exit the outer scope of a function marked **`noexcept`**, [`std::terminate`](../standard-library/exception-functions.md#terminate) is invoked immediately, and there's no guarantee that destructors of any in-scope objects will be invoked. Use **`noexcept`** instead of the dynamic exception specifier `throw()`. The *dynamic exception specification*, or `throw(optional_type_list)` specification, was deprecated in C++11 and removed in C++17, except for `throw()`, which is an alias for `noexcept(true)`. We recommended you apply **`noexcept`** to any function that never allows an exception to propagate up the call stack. When a function is declared **`noexcept`**, it enables the compiler to generate more efficient code in several different contexts. For more information, see [Exception specifications](exception-specifications-throw-cpp.md).
28
31
29
32
## Example
30
33
@@ -42,5 +45,5 @@ T copy_object(const T& obj) noexcept(std::is_pod<T>)
42
45
43
46
## See also
44
47
45
-
[Modern C++ best practices for exceptions and error handling](errors-and-exception-handling-modern-cpp.md)<br/>
0 commit comments