Код: Выделить всё
#include
#include
#include
#include
int main()
{
struct boo{
bool b;
bool get(){ return b; }
};
std::vector bools{ {0}, {0}, {0}, {1}, {0} };
if(std::ranges::any_of(bools, &boo::b )){
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79766762/is-it-okay-to-pass-projection-as-predicate-argument-to-stdrangesany-of-all-o[/url]
Мобильная версия