"sks_cpp" <sk*****@hotmail.com> schrieb im Newsbeitrag
news:on*********************@news2.central.cox.net ...
The for_each library function - does it throw any exceptions if the
functor you pass it DOESN'T throw anything.
Example:
class Functor
{
bool operator()(int a) { if (a>10) return true; }
};
std::list<int> intList; // contains some integers in the container
for_each( intList.begin(), intList.end(), Functor() );
Actually your program is allowed to do anything it likes, when the list
containes integers that are smaller or equal to 10, because
Functor::operator()(int)'s return value is not specified, which invoces
undefined behaviour. So, it even might throw an exception, but I think the
probability is not very high.:)
Norbert