shared_ptr Derived types cannot be implicitly cast to the share_ptr Base types with gsl::not_null #1187
Labels
Status: Blocked
Cannot proceed due to external factors
Status: Open
Needs attention
Type: Bug
Indicates a bug or error
Describe the bug
When I try to change function A to return a gsl::not_null<std::shared_ptr> instead of std::shared_ptr, it causes problems in function B that returns the result of function A as a std::shared_ptr
To Reproduce
Expected behavior
I expect the code above to compile and work exactly the same with or without the gsl::not_null
Spec (please complete the following information):
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29335 for x64
All C++ versions
Additional context
Changing the implicit conversion operator:
To a templatized version seems to fix this issue:
The text was updated successfully, but these errors were encountered: