I
ibe
Hi,
i can't get the clue:
I have had 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---
by means of the boost::bind i could express the loop with
std::for_each(list_.begin(), list_.end(),
bind(mem_fun(&Foo::accept), _1, v));
fine!
But now things changed to something like
std::deque<boost::sha
i can't get the clue:
I have had 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---
by means of the boost::bind i could express the loop with
std::for_each(list_.begin(), list_.end(),
bind(mem_fun(&Foo::accept), _1, v));
fine!
But now things changed to something like
std::deque<boost::sha