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.