All pastes #1081347 Raw Edit

Anonymous

public cpp v1 · immutable
#1081347 ·published 2008-07-24 00:45 UTC
rendered paste body
#if (FOR_ALTERNATIVE == 0)    for (std::vector<Project*>::iterator it = projects_to_update.begin(); it != projects_to_update.end(); ++it) {        Project* p = *it;        p->contact_scheduler();    }#elif (FOR_ALTERNATIVE == 1)    for (auto it = projects_to_update.begin(); it != projects_to_update.end(); ++it) {        Project* p = *it;        p->contact_scheduler();    }#elif (FOR_ALTERNATIVE == 2)    for (Project* p : projects_to_update) {        p->contact_scheduler();    }#elif (FOR_ALTERNATIVE == 3)    class Updater {        void operator()(Project* p) const { p->contact_scheduler(); }    };    std::for_each(projects_to_update.begin(), projects_to_update.end(), Updater());#elif (FOR_ALTERNATIVE == 4)    std::for_each(projects_to_update.begin(), projects_to_update.end(), sigc::mem_fun(&Project::contact_scheduler));#endif