Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++exception-safety guaranteesSingle-choice MCQ

What does the copy-and-swap idiom rely on to deliver the strong exception guarantee for `operator=`?

T& operator=(T other) { // by value swap(*this, other); return *this; }