gsl::strict_not_null: C.66 Make move ctor noexcept#1245
Conversation
boost::intrusive_ptr exists and has a potentially throwing copy constructor.
It does. I think this is going to be a case where the GSL implementation is not going to conform to the guidelines because a specific decision was made to implement the WDYT? @gdr-at-ms |
Ok, I see. I think GSL being flexible and fully supporting such a throwing copy ctor seems reason enough to close this. After all, everyone who marks their copy ctors as Closing for now, but happy to re-open, if GSL decides to follow C.66 |
The
strict_not_nullmove ctor actually calls the copy ctor, as explained in the comment added in commit d69e578. The comment also says that a custom pointer type copy ctor "could in theory throw exceptions". However, I don't think that such a smart pointer type should exist in practise.Also, it violates C66, see https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c66-make-move-operations-noexcept
So just use a
noexceptfor all types.