C++相談室 part98
■ このスレッドは過去ログ倉庫に格納されています
0269デフォルトの名無しさん
2012/09/08(土) 20:17:48.91staticメンバか関数オブジェクトしか渡せない(?)
mem_funみたいな便利な関数ありますか?
#include <algorithm>
class A {
bool positive(int x) { return x>0; }
public:
bool test() const {
int a[] = {3,2,4};
return std::all_of(a,a+3,positive);
}
};
int main()
{
A a;
a.test();
}
■ このスレッドは過去ログ倉庫に格納されています