Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-17 14:25:01


From: "Peter Dimov" <pdimov_at_[hidden]>

> From: "David Abrahams" <dave_at_[hidden]>
> >
> > We've thought about it, and haven't come up with an answer. The details
> > (like the fact that operator[] might be overloaded, which pretty much
> rules
> > out the approach above) are non-trivial. If /you/ can fill in the
details,
> > I'm interested. I've already tried and failed.
>
> For non-const iterators,
>
> yes test(value_type &);
> no test(...);
>
> test(a[i]);
>
> For const iterators, the technique doesn't work, but return by value
works
> adequately there.

That's not legal in the case where a[i] is a non-POD value type, is it? I
thought that passing a non-POD to a ... argument invokes undefined
behavior.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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