Skip to content

Commit fe9bed2

Browse files
authored
F.6 noexcept
1 parent 0459ef4 commit fe9bed2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CppCoreGuidelines.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2740,9 +2740,13 @@ low-level functions.
27402740
Destructors, `swap` functions, move operations, and default constructors should never throw.
27412741
See also [C.44](#Rc-default00).
27422742

2743+
##### Note
2744+
2745+
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.
2746+
27432747
##### Enforcement
27442748

2745-
* Flag functions that are not `noexcept`, yet cannot throw.
2749+
* (hard) Flag low-level functions that are not `noexcept`, yet cannot throw.
27462750
* Flag throwing `swap`, `move`, destructors, and default constructors.
27472751

27482752
### <a name="Rf-smart"></a>F.7: For general use, take `T*` or `T&` arguments rather than smart pointers

0 commit comments

Comments
 (0)