|
Boost : |
Subject: Re: [boost] AlRangeExandrescu?
From: David Abrahams (dave_at_[hidden])
Date: 2009-07-23 14:14:24
on Thu Jul 23 2009, Thorsten Ottosen <thorsten.ottosen-AT-dezide.com> wrote:
> David Abrahams skrev:
>> Hi Neil,
>>
>> I'm sure someone already spoke to you about this, but just in case: Andrei
>> Alexandrescu gave a very interesting presentation at BoostCon that was based on a
>> "ranges only" approach that should eliminate issues like this one:
>>
>> 2: return type specification for find() etc
>> ===========================================
>> There where no major objection to the mechanism, but some found
>> the syntax ugly. I believe the suggested syntax (e.g.)
>>
>> boost::find[_f,_e]( range, x )
>>
>> boost::find[_f+1,_e]( range, x )
>>
>>
>> He says he's implemented a superset of the STL algorithms with it so we know the
>> expressive power is fairly complete.
>
> If I remember correctly, he claims that his return of find() is the "correct" one. I
> think that is plain wrong, as the syntax above shows that there are many useful return
> ranges, perhaps with an obvious default.
Regardless, there could still be a single correct answer from the
standpoint of aesthetics, purity, and orthogonality. If
drop_front(find(range, x))
does the same thing as
find[_f+1,_e]( range, x )
then you don't need the complicated meta-goop in there.
> So the above is not an "issue" IMO, but a usable feature.
Whether or not it's a feature and/or usable isn't relevant to the issue
I'm raising.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk