2010-09-24から1日間の記事一覧

all,any

C++

allはすべてがtrueならtrueを、そうでなければfalseを返します。 anyはどれか一つがtrueならtrueを、そうでなければtrueを返します。 bool all(shared_ptr<cIterable<bool>> g) { while(g->exists_next()) { if(!g->value()) return false; } return true; } bool any(shared</citerable<bool>…