完成none_of

This commit is contained in:
邹晓航
2014-10-17 17:28:03 +08:00
parent 2c042b6d51
commit 31f619bbd6

View File

@@ -197,6 +197,16 @@ namespace TinySTL{
}
return false;
}
//********** [none_of] *************************
//********* [Algorithm Complexity: O(N)] ****************
template <class InputIterator, class UnaryPredicate>
bool none_of(InputIterator first, InputIterator last, UnaryPredicate pred){
for (; first != last; ++first){
if (pred(*first))
return false;
}
return true;
}
}