Closed zann1x closed 1 year ago
I switched to the copy-and-swap implementation based on OOP54-CPP. Gracefully handle self-copy assignment. Alternatively, I think that we should at least check for self-assignment in the copy constructor.
I don't have a strong opinion about it, though. So if you think we should keep the old copy logic, I'll happily revert that part.
Oops, embarrassing not to have noticed that we had a self-assignment problem currently, thanks for pointing this out. I agree that this should be fixed, but I still think that if we change it like this we'd also need to change the ctor to avoid having the not very useful make_safe_copy()
. So adding a check for &e == this
would still be simpler...
Sure thing, let's do &e == this
then.
I don't have access to my workstation until monday, so you'll have to wait a bit :)
Sorry for the delay, finally merged, thanks again!
According to the CERT C++ Coding Standard rule ERR60-CPP. Exception objects must be nothrow copy constructible, SOCI's base exception
soci_error
should havenoexcept
copy constructors. The exception classes derived fromsoci_error
don't have copy constructors, i.e. they adhere to this rule automatically.