You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present, the Object has an interface that returns the type std::optional<T*>. This return type is troublesome for the user. Is the returned pointer pointing to a valid address? In fact, the pointer here is always valid. This would not be a problem if the return type was std::optional<std::reference_wrapper<T>>.
The text was updated successfully, but these errors were encountered:
zyfjeff
changed the title
replace std::optional<T*> to std::optional<std::reference_wrapper<T>>
replace std::optional<T*> to std::optional<std::reference_wrapper<T>>
Dec 29, 2020
At present, the Object has an interface that returns the type std::optional<T*>. This return type is troublesome for the user. Is the returned pointer pointing to a valid address? In fact, the pointer here is always valid. This would not be a problem if the return type was
std::optional<std::reference_wrapper<T>>
.The text was updated successfully, but these errors were encountered: