malt icon indicating copy to clipboard operation
malt copied to clipboard

Improve exception safety with smart pointers

Open elfring opened this issue 6 years ago • 3 comments

Would you like to wrap any pointer data members with the class template “std::unique_ptr”?

Update candidates:

elfring avatar Feb 07 '19 13:02 elfring

Yes will do, thanks for looking my code, that's really nice. If you find some other stuff, don't limit yourself.

svalat avatar Feb 18 '19 11:02 svalat

Ok, that require a little bit more work as I didn't yet enabled CXX11 on this project to keep portability on old HPC systems. But will look, now it should be fine mostly on all distributions.

It needs to rewrite the - STLInternalAllocator.

Also I looked on the lines. You speak about the dyanmic arrays ? That's more moving them to std::vector & std::array than using std::unique_ptr no ? Otherwise it will messup if I put composed types inside the ProfiledValue class.

svalat avatar Feb 21 '19 23:02 svalat

I suggest to take another look at the implementation detail when some new and delete operators are used in affected C++ classes.

elfring avatar Feb 22 '19 06:02 elfring