Boost logo

Boost :

Subject: Re: [boost] Is Boost interested in the Boost-based Base64 library
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-06-09 18:13:58


On 09/06/2011 21:04, Denis Shevchenko wrote:
>> 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.

Exactly where is flexibility lost?


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