I do this kindda stuff often:
class CVisitableObjectVector : public
std::vector<Loki::BaseVisitable<>*> {
void Enable(bool enable);
....
};
void CVisitableObjectVector::Enable(bool enable) {
CLokiVisitor Visitor(enable);
CVisitableObjectVector::iterator i = begin();
for (; i != end(); i++) {
(*i)->Accept(Visitor);
}
}
Can that for(;;;) loop be replaced with the std::for_each algorithm?
I've tried with no success. I've used ptr_fun, mem_fun etc.. Nothing
works. Has anyone out there done this?
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----