how to use non-static member function as comparision function in find_if?
From: John Black (black_at_eed.com)
Date: 05/31/04
- Next message: Tito: "Re: Alexei's singletons"
- Previous message: Rolf Magnus: "Re: strings"
- Next in thread: Daniel T.: "Re: how to use non-static member function as comparision function in find_if?"
- Reply: Daniel T.: "Re: how to use non-static member function as comparision function in find_if?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 16:03:36 -0600
Hi,
In using find_if() you need to name a comparision function which
normally is a static function, but sometimes it is really inconvinient
for this, let's take this example,
class MyClass{
vector<int> myVec;
void func();
};
When MyClass::func() needs to call find_if against myVec, I have to
decalre a static function for it, but myVec is not static, it can not be
referenced in static function, then I have to consider convert myVec to
static...
Looks like I miss something in between, there should be some way to do
this.
Thanks.
- Next message: Tito: "Re: Alexei's singletons"
- Previous message: Rolf Magnus: "Re: strings"
- Next in thread: Daniel T.: "Re: how to use non-static member function as comparision function in find_if?"
- Reply: Daniel T.: "Re: how to use non-static member function as comparision function in find_if?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]