本文整理汇总了C++中util::for_each方法的典型用法代码示例。如果您正苦于以下问题:C++ util::for_each方法的具体用法?C++ util::for_each怎么用?C++ util::for_each使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util::for_each方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
virtual void
run (Arg)
{
_checksum = 0;
_create_count = 0;
{
TestList objs = createDummies ();
for_each (objs, reAccess);
checkHandling (objs);
checkSpecialSubclass ();
}
CHECK (0 == _checksum); // all dead
}
示例2: run
virtual void
run (Arg)
{
_checkSum = 0;
_callSum = 0;
_created = 0;
verifyBasics();
{
TestList objs = createOpaqueValues ();
for_each (objs, operate);
}
CHECK (0 == _checkSum); // all dead
verifyOverrunProtection();
verifyCopySupportDetectionMetafunctions();
}
示例3: Logic
void
triggerStartup (Subsys* susy)
{
REQUIRE (susy);
if (susy->isRunning()) return;
INFO (subsystem, "Triggering startup of subsystem \"%s\"", cStr(*susy));
for_each (susy->getPrerequisites(), start_);
bool started = susy->start (opts_, bind (&SubsystemRunner::sigTerm, this, susy, _1));
if (started)
{
if (susy->isRunning())
running_.push_back (susy); // now responsible for managing the started subsystem
else
throw error::Logic("Subsystem "+string(*susy)+" failed to start");
}
if (!and_all (susy->getPrerequisites(), isRunning() ))
{
susy->triggerShutdown();
throw error::State("Unable to start all prerequisites of Subsystem "+string(*susy));
} }
示例4: guard
void
shutdownAll ()
{
Lock guard (this);
for_each (running_, stopIt_);
}