Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-12-20 11:59:41


From: "Joel de Guzman" <djowel_at_[hidden]>
[...]
> The condition is expected to be a functor that returns
> a boolean condition. I was hoping that I can use the
> ref(b) as a functor such that I can write:
>
> bool b;
>
> if_p(ref(b))
> [
> parse_this
> ]

Not a good idea. In lambda terms the above is var(b), not ref(b). We've been
using ref(x) to mean "just like x", i.e. ref(b)() means b(). One day we
might even get that core change that would enable
reference_wrapper<T>::operator T& to be considered in a ref(f)() expression;
for now, we "fake" it in bind, function, etc.


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