alibaba / hessian2-codec

hessian2-codec it is a complete C++ implementation of hessian2 spec
Apache License 2.0
26 stars 9 forks source link

replace std::optional<T*> to std::optional<std::reference_wrapper<T>> #3

Closed zyfjeff closed 1 year ago

zyfjeff commented 3 years ago

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>>.

wbpcode commented 2 years ago

/assign

wbpcode commented 2 years ago

I will try land it and make the implementation more clean. 😄

zyfjeff commented 1 year ago

close by #20