Skip to main content

2 docs tagged with "exception-safety"

View all tags

Copy-and-Swap Idiom

Copy-and-swap is an elegant technique for implementing assignment operators that provides strong exception safety and eliminates code duplication by leveraging the copy constructor and a non-throwing swap function.

noexcept and Strong Guarantee

The noexcept specifier indicates that a function won't throw exceptions. The strong exception guarantee ensures that operations either succeed completely or have no effect. Together, they enable writing robust, exception-safe code.