C++ Logo

std-proposals

Advanced search

Re: Finding the index of an element (std::find_first_index)

From: Simon Kraemer <sikraemer_at_[hidden]>
Date: Sat, 3 Oct 2020 13:20:22 +0200
My fault.
I missed that part.

Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden]>
schrieb am Sa., 3. Okt. 2020, 12:52:

> Il 03/10/20 11:42, Simon Kraemer via Std-Proposals ha scritto:
> > > auto i = /* insert std_find_if + distance or the proposed template to
> > search in bigDynamicList. */
> > > someLUT[i] = 42;
> >
> > Why not just use iterators as they are meant to be used?
> >
> > auto iter = std::find(...);
> > *iter = 42;
> >
> > Same number of lines, no duplicate lookup.
>
> The example uses two different containers. You find the index in one
> container, and use it to index in the second. How do you use iterators
> to do the same?
>
> Thanks,
>
> --
> Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2020-10-03 06:20:35