oneTBB
oneTBB copied to clipboard
Mark relevant functions noexcept
Please mark relevant functions in TBB noexcept. In particular, consider these members:
- Default constructors, where possible
- Move constructors
- Move assignment
swapmembers and free functions- Comparison operators
- Hash functions
Having the correct noexcept specification is important for:
- User's types that use TBB types for members. Default constructors, assignment and comparison functions inherit
noexceptspecification from the corresponding functions of the class' members, so if the TBB type omitsnoexcept, the downstream type also does. swapis often used in contexts where failure is not an option (e.g. as a means to roll back a failed operation, e.g. to maintain strong guarantee). Thus it is strongly preferred to be a non-throwing operation.swapis also sometimes used for move implementation.- Having move constructors
noexceptis important for some containers, e.g.std::vector, as this allows for a more optimal implementation of some of its operations. - Having comparison and hash functions
noexceptensures that lookup functions in associative containers will not throw.
clang-tidy might help to find move constructors and assign operators
@isaevil , FYI