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
Why boost::reference_wrapper template class dosn't has operator-> overloading? Is there any objective reason?
It may be useful for some instantiations, like boost::reference_wrapper<Object*> or like boost::reference_wrapper<std::shared_ptr<Object>> to use these without casting
The text was updated successfully, but these errors were encountered:
I suspect you're misunderstanding the request as T* operator-> whereas it's T& operator->.
reference_wrapper<T> is intended to act as a reference to T and has an implicit conversion operator T&, which enables this. It also has a forwarding operator() because the conversion doesn't work in this case. The request makes sense, the reason for not having operator-> is because nobody brought it up until now.
Why
boost::reference_wrapper
template class dosn't hasoperator->
overloading? Is there any objective reason?It may be useful for some instantiations, like
boost::reference_wrapper<Object*>
or likeboost::reference_wrapper<std::shared_ptr<Object>>
to use these without castingThe text was updated successfully, but these errors were encountered: