Subject: Re: [std-proposals] Finding the index of an element (std::find_first_index)
From: Dvir Yitzchaki (dvirtz_at_[hidden])
Date: 2020-10-01 14:21:54
can be expressed as
auto [index, it] = ranges::find_if(range | views::enumerate, pred);
On Thu, 1 Oct 2020 at 20:32, Matthew Woehlke via Std-Proposals <
> On 01/10/2020 12.56, Kosher Yosher via Std-Proposals wrote:
> > The return type of std::distance also doesn't
> > cover the entire container range.
> This is (mostly) untrue; there is actually a proof floating around
> somewhere that it is impossible for an in-memory container to have more
> than numeric_limits<intptr_t>::max() elements.
> That said, it would seem to make sense for the result type to be the
> same as the indexing type... although *both* of those ought to be
> signed. Unfortunately, that ship sailed some time ago.
> Std-Proposals mailing list
STD-PROPOSALS list run by firstname.lastname@example.org
Standard Proposals Archives on Google Groups