Boost logo

Boost :

From: Jon Jagger (jon.jagger_at_[hidden])
Date: 2000-05-30 15:38:32


Hi,
I'm sure it's just me not knowing some obscure corner of C++, but what is a
mutable reference?

> template <class X, class Y>
> struct tied
> {
> tied(X& x, Y& y) : m_x(x), m_y(y) {}
>
> template <class T1, class T2>
> void operator=(const std::pair<T1,T2>& p)
> { m_x = p.first; m_y = p.second; }
> mutable X& m_x;
> mutable Y& m_y;
> };
>
> template <class X, class Y>
> tied<X, Y> tie(X& x, Y& y) { return tied<X,Y>(x,y); }

Thanks in advance

Jon Jagger


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk