This article talks about how modern C++ unique_ptr tool can be used to achieve exception safety.
Simplifying code and achieving exception safety using unique_ptr
by Marshall Clow
From the article:
The general pattern for this is:
unique_ptr<T> holder(new T{/* params */});
// set up some stuff that uses holder.get()
holder.release();

Add a Comment
Comments are closed.