not_null conversion operator for non-copy constructible types #991
Labels
Priority: Low
Can be handled at leisure
Status: In Progress
Currently being worked on
Type: Bug
Indicates a bug or error
gsl::not_null< T >
has the following conversion operator:which is deleted for non-copy constructible types such as
std::unique_ptr
due togsl::not_null< T >
's conditional return type mapping toconst T&
:Therefore, it is not possible to extract (the potentially expensive)
ptr_
anymore for non-copy constructible types once agsl::not_null< T >
is constructed around it. Wouldn't it make sense to use ref-qualified member methods for both methods (i.e. conversion operator andget
)?The text was updated successfully, but these errors were encountered: