Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The universe does not have laws -- it has habits, and habits can be broken.


devel / comp.lang.c++ / Re: Help with generic algorithm/predicate

SubjectAuthor
o Re: Help with generic algorithm/predicateV

1
Re: Help with generic algorithm/predicate

<1ed1fcfb-c566-4e9b-82f4-4622c31e0b73n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=847&group=comp.lang.c%2B%2B#847

  copy link   Newsgroups: comp.lang.c++
X-Received: by 2002:a05:6214:1090:b0:635:bcd1:868b with SMTP id o16-20020a056214109000b00635bcd1868bmr25603qvr.6.1689383548143;
Fri, 14 Jul 2023 18:12:28 -0700 (PDT)
X-Received: by 2002:a05:6808:2128:b0:3a2:6d0f:5b27 with SMTP id
r40-20020a056808212800b003a26d0f5b27mr8884927oiw.2.1689383547965; Fri, 14 Jul
2023 18:12:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c++
Date: Fri, 14 Jul 2023 18:12:27 -0700 (PDT)
In-Reply-To: <3d9c72a5$0$69032$edfadb0f@dspool01.news.tele.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=82.131.36.224; posting-account=HO2hOwoAAABpduKOvjE7DqN40zymoYvB
NNTP-Posting-Host: 82.131.36.224
References: <3d9c72a5$0$69032$edfadb0f@dspool01.news.tele.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1ed1fcfb-c566-4e9b-82f4-4622c31e0b73n@googlegroups.com>
Subject: Re: Help with generic algorithm/predicate
From: vvvvvvvv...@hotmail.com (V)
Injection-Date: Sat, 15 Jul 2023 01:12:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2694
 by: V - Sat, 15 Jul 2023 01:12 UTC

anglezzzzzzz.likesyou.org/a.php⠀⠀⠀⠀⠀⠀⠀ ⠀⠀
christyansworld.atwebpages.com/a.php⠀⠀⠀⠀⠀⠀⠀
youthmeetupplace.talk4fun.net/a.php⠀⠀⠀⠀⠀⠀⠀⠀
kohtumispaik3.66ghz.com/a.php⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Heia...........Heida pilk peale nendele............

Postita ka midagi sinna.

Siis pärast hea mul lugeda, et mu lehtedel on mõni külastaja ka !

Morten Brix Pedersen kirjutas neljapäev, 3. oktoober 2002 kl 19:36:23 UTC+3:
> Hi,
> I have the following class:
> class Foo
> {
> public:
> Foo();
> bool var1;
> bool var2;
> bool var3;
> bool var4;
> };
> I then have a vector<Foo*> containing quite a lot of elements.
> Now, I want to be able to say "remove all elements which have var1 set to
> true".
> I can do this:
> bool myPredic(Foo *foo)
> {
> if (foo->var1)
> return true;
> else
> return false;
> }
>
> users.erase(remove_if(users.begin(), users.end(), myPredic), users.end());
> This works fine - however, I also need to have the possibility to do the
> same with var2, var3 and var4. But not at the same time.
> Is there any smart way I can solve this, instead of creating 4 variations of
> the myPredic predicate?
> Thanks.
> --
> - Morten.


devel / comp.lang.c++ / Re: Help with generic algorithm/predicate

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor