|
Boost : |
Subject: Re: [boost] Painting a bikeshed ...
From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2015-10-01 11:38:25
On Thu, Oct 1, 2015 at 9:50 AM, Roland Bock <rbock_at_[hidden]> wrote:
> On 2015-10-01 16:24, Marshall Clow wrote:
> > I've used "partition_subrange", but that not that clear.
> > Sean has suggested "elements_in_subrange" and "elements_within_subrange".
> >
> > Here's the declaration:
> >
> > template<typename Iterator, typename Pred>
> > void partition_subrange (
> > Iterator first, Iterator last,
> > Iterator sub_first, Iterator sub_last,
> > Pred p)
> >
> > /// \brief Gather the elements of the subrange [sub_first, sub_last) that
> > is
> > /// inside the range [first, last) as if you had sorted the entire
> > range.
> >
> > Any suggestions?
>
> Assuming that the elements in [first, sub_first) are also less or equal
> to the element at sub_first, this is quite similar to nth_element, isn't
> it? Then you could call it
>
> mth_to_nth_element
>
> Not too smooth, but it should be clear to anyone who knows about
> nth_element.
+1 for associating the name of the new function with nth_element().
Zach
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk