This patch ensures that algorithms in libc++ use const overloads for predicate operators. It also adds a file called test_predicates.h which holds helpful testing predicates. See bug 34536 and LWG3031 for reference.
Nit: typo -- should be stateful.
Ping. I can split this into three patches if that would be better.