Use for loop, (void)
https://godbolt.org/z/rrnzhdoGn I just made some test code things appear to still work.
Using for loop instead of while
For loop can iterate and check the condition in the same line.
Cast to void
(void), comma operator can be overloaded. So you need to cast to void to force using the built-in comma operator. I'm not sure you can defend against all uses of an overloaded comma operator. I'm not 100% sure when this is needed. So I used it in places where the return value isn't required. Like when you are iterating the iterators. Someone said it's a very uncommon overload and they only saw it used in boost. Though it can happen. std::transform uses the (void) cast.
- https://blog.codeisc.com/2018/01/09/cpp-comma-operator-nice-usages.html
- https://blog.codeisc.com/2017/12/26/cpp-comma-operator-introduction.html
- https://stackoverflow.com/questions/39514765/the-void-the-comma-operator-operator-and-the-impossible-overloading
- https://stackoverflow.com/questions/38357089/why-does-stdtransform-and-similar-cast-the-for-loop-increment-to-void
- https://en.cppreference.com/w/cpp/language/operator_other
- https://www.reddit.com/r/cpp/comments/1tedni/notsocommon_pitfalls_of_c_xpost_rcplusplus/ce7bqnu/
Remove const
Mutable lambdas couldn't be passed to these functions. So we had to remove const fixes: https://github.com/codereport/An-Algorithm-Library/issues/13
Forwarding Ref
any_of is passing the members directly to the find function. I think it's better to forward anything any_of doesn't use.
I rewatched this talk for a refresher.

Removing as const. As this isn't something the standard does. We aren't mutating the data but the caller might want to.