What is the difference between boost::ref(i) and & i ? What are the situations where we cannot use regular references and have to go for boost::ref instead? Please include examples if possible.
What is the difference between boost::ref(i) and & i ? What are the situations
Share
From the Boost.Ref Documentation:
NB: An important difference between
boost::reference_wrapperandstd::reference_wrapper(at least of Boost 1.52) is the ability ofstd::reference_wrapperto perfectly wrap function objects.This enables code like this: