Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-06-11 18:30:14


From: <jsiek_at_[hidden]>

>
> Workaround idea: have the friend functions call other template
> functions that have both "real" versions and "dummy" versions. The
> "dummy" versions would be selected when the iterators do not support
> the operation.

The problem with that is that you'd be able to compile code that does any of
the following with wrapped bidirectional iterators p, q:

q = p + 5
int x = p - q;
p[4]

We don't want that, do we? I sure don't

I'm not sure the B&N trick buys us much in this case. It's just a
convenience for library writers, but nobody said a library writer's life
would always be easy... ;)

-Dave


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