Boost logo

Boost :

From: helmut.zeisel_at_[hidden]
Date: 2001-07-27 01:09:21


--- In boost_at_y..., Daryle Walker <darylew_at_m...> wrote:
> It's weird how something you think is minor blows up to something
major....
>
> If you have problems with conveniently using an entire container
with an
> algorithm, what about:
>
> #define BOOST_RANGE(x) (x).begin(),(x).end()
>

This is not fair, you are usingthe preprocessor ;-)

In message 15227, I wrote

-> Interface 2 has the advantage that it is used
-> in the standard C++ algorithms.
-> It has the disadvantage that there is no possibility
-> (or at least that I do not know one)
-> to switch to interface 1 without writing
-> a second wrapper algorithm for every existing standard algorithm.

Your macro is exactly this possibility.
I do not like it, because it uses the preprocessor,
and Bjarne Stroustrup likes to se the preprocessor abolished.
Now it comes again through the backdoor...

This is again an example where the simplicity
of the preprocessor helps to work around language restrictions.

Helmut

                 in the standard C++ algorithms.
                 It has the disadvantage that there is no possibility
                 (or at least that I do not know one)
                 to switch to interface 1 without writing
                 a second wrapper algorithm for every existing
standard algorithm.


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