Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F.6 noexcept Issue #2220 #2264

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CppCoreGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -2740,9 +2740,13 @@ low-level functions.
Destructors, `swap` functions, move operations, and default constructors should never throw.
See also [C.44](#Rc-default00).

##### Note

Care must be taken on base virtual functions and functions part of a public interface because declaring a function `noexcept` is establishing a guarantee that all current and future implementations must abide by. For virtual function, all overriders must also be `noexcept` and removing `noexcept` from a function could break calling functions.

##### Enforcement

* Flag functions that are not `noexcept`, yet cannot throw.
* (hard) Flag low-level functions that are not `noexcept`, yet cannot throw.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a definition somewhere, what low-level means?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a definition somewhere, what low-level means?

Not defined but a note has "noexcept is most useful (and most clearly correct) for frequently used, low-level functions.". Maybe better to delete the bullet?

* Flag throwing `swap`, `move`, destructors, and default constructors.

### <a name="Rf-smart"></a>F.7: For general use, take `T*` or `T&` arguments rather than smart pointers
Expand Down
1 change: 1 addition & 0 deletions scripts/hunspell/isocpp.dic
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ overabstract
overconstrain
overconstrained
overridable
overriders
p1
p2
p3
Expand Down