C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Missing logical identity in <functional>
From: Alexander Klein (xelalex_maker_at_[hidden])
Date: 2019-08-25 11:28:15


Hi all,

thanks for the replies so far!

I think that Miguel's solution

all_of(v.cbegin(), v.cend(), identity())

is most in the spirit of

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rp-what

… but it will be a long time before most of us will be able to use
C++20, I'm afraid!

As for Arthur's ideas, all of them, aside from the one with std::find
are in the original attachment, but I think that only the latter and the
one using a lambda qualify as real solutions in the sense of the Core
Guidelines, unless you deliberately want to leave silly puzzles for the
next maintenance programmer.

Best,

        Alexander


STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups