给定const vector<bool> foo(13)用途find:
cout << (find(foo.begin(), foo.end(), false) == foo.end()) << endl;
cout << none_of(cbegin(foo), cend(foo), logical_not<bool>()) << endl;
或者,如果您vector在编译时知道's 的大小,则可以使用bitset'aall方法:
bitset<13> foo;
cout << foo.all() << endl;