在c ++ 20中提出,一些算法是constexpr.
例如:
template< class InputIt, class UnaryPredicate >
bool all_of( InputIt first, InputIt last, UnaryPredicate p );
(since C++11)
(until C++20)
template< class InputIt, class UnaryPredicate >
constexpr bool all_of( InputIt first, InputIt last, UnaryPredicate p );
(since C++20)
Run Code Online (Sandbox Code Playgroud)
虽然我们知道迭代器通常不是constexpr.我认为这只适用于constexpr容器.有人可以澄清我是否遗漏了某些内容以及我的理解是否正确?