I
ibe
Hi,
i can't get the clue:
I hav a loop in my code like this:
---snip---
class Foo {
accept(Visitor& v) {
v.visit(*this);
}
};
class Visitor {
visit (Foo& f) {
...
}
}
....in main...
Visitor v(arugments, ...);
for (std::deque<Foo*>::iterator iter = list_.begin();
iter != m_list.end();
++iter) {
(*iter)->accept(v);
}
---snip---
Now i would like to do this with for_each. I think i need std::mem_fun (or
bind1st ?!?).
Can anyone help me?
htx
ibe
i can't get the clue:
I hav a loop in my code like this:
---snip---
class Foo {
accept(Visitor& v) {
v.visit(*this);
}
};
class Visitor {
visit (Foo& f) {
...
}
}
....in main...
Visitor v(arugments, ...);
for (std::deque<Foo*>::iterator iter = list_.begin();
iter != m_list.end();
++iter) {
(*iter)->accept(v);
}
---snip---
Now i would like to do this with for_each. I think i need std::mem_fun (or
bind1st ?!?).
Can anyone help me?
htx
ibe