Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-07-22 08:08:45

Giovanni Bajo wrote:

>Arkadiy Vertleyb wrote:
> > One more addition to the typeof library is a macro, that, unlike
> > BOOST_TYPEOF(), which removes top-level consts and references,
> > attempts to be closer to the decltype, by preserving lvalue-ness of
> > its argument:
> >
> >
> > I do admit that the name is quite clumzy :(

Well, unfortunately, it's not exactly decltype :(

In particular:

int i;
const int ci = 0;

                decltype BOOST_TYPEOF_PRESERVE_LVALUE
                -------- ----------------------------
i int int&
ci const int const int&


It is calculated by binding a T& to the expression. If it can't be bound the
type is the same as one returned by BOOST_TYPEOF. If it can, it's either
reference or const reference, depending on the constness of T.

Any suggestions how to make it closer to the real decltype?


Boost list run by bdawes at, gregod at, cpdaniel at, john at