Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #82404
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: equal_range sucks ! |
| Date | 2021-11-23 16:04 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <snivuo$d2n$1@dont-email.me> (permalink) |
| References | <snivjr$afv$1@dont-email.me> |
Am 23.11.2021 um 15:59 schrieb Bonita Montero:
> I just tried this:
>
> pair<cpu_it, cpu_it> foundApicId = equal_range( apicIds.begin(),
> apicIds.end(),
> apicId, []( cpu_apic_id const &idRange, unsigned apicId ) {
> return idRange.apicId == apicId; } );
>
> It should be possible that the key for the range has a different type
> than than the elemnens in the range so that I can compare against a
> part of the range-objects like in the above code.
>
> Instead I'd hat to write:
>
> pair<cpu_it, cpu_it> foundApicId = equal_range( apicIds.begin(),
> apicIds.end(),
> cpu_apic_id( -1, apicId ), []( cpu_apic_id const &idRange,
> cpu_apic_id const &id ) { return idRange.apicId == id.apicId; } );
>
And even more: I've to use const-references in my lambda.
Who thinks up such nonsense ?
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 15:59 +0100
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 16:04 +0100
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 17:13 +0100
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-23 19:53 +0100
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-25 15:02 +0100
Re: equal_range sucks ! Juha Nieminen <nospam@thanks.invalid> - 2021-11-24 08:06 +0000
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-24 18:18 +0100
Re: equal_range sucks ! Marcel Mueller <news.5.maazl@spamgourmet.org> - 2021-11-28 12:36 +0100
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-28 17:04 +0100
Re: equal_range sucks ! Bonita Montero <Bonita.Montero@gmail.com> - 2021-11-28 17:23 +0100
csiph-web