Skip to content

Commit 2f445f0

Browse files
authored
Merge pull request #1 from modi1123/modi1123-patch-1
Fix typo and bad syntax
2 parents ae23be0 + 6cadf74 commit 2f445f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/cpp/noexcept-cpp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ translation.priority.ht:
3939

4040
```cpp
4141
ReturnType FunctionName(params) noexcept;
42-
ReturnType FunctionName(params) noexcept(noexcept(expression);
42+
ReturnType FunctionName(params) noexcept(expression);
4343
```
4444
4545
#### Parameters
4646
expression
4747
A constant expression that evaluates to true or false. The unconditional version is equivalent to noexcept(true).
4848
4949
## Remarks
50-
`noexcept` ( and its synonym `noecept(true)`) specify that the function will never throw an exception or allow an exception to be propagated from any other function that it invokes either directly or indirectly. More specifically, `noexcept` means the function is `noexcept` only if all the functions that it calls are also noexcept or const, and there are no potentially evaluated dynamic casts that require a run-time check, typeid expressions applied to a glvalue expression whose type is a polymorphic class type, or throw expressions. However, the compiler does not necessarily check every code path for exceptions that might bubble up to a `noexcept` function. If an exception does reach 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.
50+
`noexcept` ( and its synonym `noexcept(true)`) specify that the function will never throw an exception or allow an exception to be propagated from any other function that it invokes either directly or indirectly. More specifically, `noexcept` means the function is `noexcept` only if all the functions that it calls are also noexcept or const, and there are no potentially evaluated dynamic casts that require a run-time check, typeid expressions applied to a glvalue expression whose type is a polymorphic class type, or throw expressions. However, the compiler does not necessarily check every code path for exceptions that might bubble up to a `noexcept` function. If an exception does reach 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.
5151
5252
A function declared with a conditional noexcept that evaluates to noexcept(false) specifies that it does permit exceptions to propagate. For example, a function that copies its argument might be declared noexcept on the condition that the object being copied is a plain old data type (POD). Such a function could be declared like this:
5353
@@ -65,4 +65,4 @@ T copy_object(T& obj) noexcept(std::is_pod<T>)
6565
Use `noexcept` instead of the exception specifier `throw`, which is deprecated in C++11 and later. We recommended you apply `noexcept` to a function when you are sure it will never allow an exception to propagate up the call stack. A function that is declared with `noexcept` enables compilers to generate more efficient code in several different contexts.
6666
6767
## See Also
68-
[C++ Exception Handling](../cpp/cpp-exception-handling.md)
68+
[C++ Exception Handling](../cpp/cpp-exception-handling.md)

0 commit comments

Comments
 (0)