Use std::count in pos_is_ok()