T
trash
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?
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(;;
I've tried with no success. I've used ptr_fun, mem_fun etc.. Nothing
works. Has anyone out there done this?