4 Apr
2022
4 Apr
'22
8:05 a.m.
On 4/4/22 03:01, Gavin Lambert via Boost wrote:
On 4/04/2022 10:58, Marshall Clow wrote:
On Apr 3, 2022, at 3:09 PM, Viktor Sehr wrote:
Why not return a pointer/nullptr instead? pfind_if
Why not just check to see if the returned iterator == end () ?
The annoyance with the iterator == end() implementation is that it's a double indirection -- if you want to access the value afterwards it has to be in a separate statement, which means you can't do it with an rvalue collection.
I don't see creating a variable as that much of a problem. Besides, C++17 adds support for variable declarations in the `if` statement.