Boost logo

Boost :

Subject: Re: [boost] Is Boost interested in the Boost-based Base64 library
From: Denis Shevchenko (for.dshevchenko_at_[hidden])
Date: 2011-06-09 15:04:08


> That interface is restrictive. Why not take iterators and ranges for
> input and output iterators for output. That would grant greater
> flexibility to source and destination: your code would be captured as
> algorithms.
>
> Rob Stewart robert.stewart_at_[hidden]

Yes, Rob, iterators are more flexible, but this flexibility is not always
necessary.

For example, we can write:

std::vector< int > v{ 1, 2, 3 };
auto it = std::find( v.begin(), v.end(), 2 );

But Boost.Range provides "less flexible" solution:

std::vector< int > v{ 1, 2, 3 };
auto it = boost::range::find( v, 2 );

IMO, this solution is much easier and safer, but less flexible.

- Denis


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