[ox/std] Make ranges predicates const refs

This commit is contained in:
Gary Talent 2024-02-17 11:43:25 -06:00
parent db2dc28f92
commit b015fe88b7

View File

@ -11,7 +11,7 @@
namespace ox {
[[nodiscard]]
constexpr bool all_of(auto begin, auto end, auto pred) noexcept {
constexpr bool all_of(auto begin, auto end, auto const&pred) noexcept {
while (begin != end) {
if (!pred(*begin)) {
return false;
@ -22,7 +22,7 @@ constexpr bool all_of(auto begin, auto end, auto pred) noexcept {
}
[[nodiscard]]
constexpr bool any_of(auto begin, auto end, auto pred) noexcept {
constexpr bool any_of(auto begin, auto end, auto const&pred) noexcept {
while (begin != end) {
if (pred(*begin)) {
return true;