Boost logo

Boost Users :

Subject: [Boost-users] reference_wrapper 101
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2011-06-13 03:55:14

I thought understood what boost::reference_wrapper was all about, and in the
of, say Boost.Bind, it seems pretty clear.

But why would you define a function to RETURN a reference_wrapper? eg

template <class T> struct X
     std::pair<boost::reference_wrapper<T>, unsigned> getSomething(....)

I suspect I'm having a 'doh' moment here!


- Rob.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at