[ox/std] Make ranges predicates const refs
This commit is contained in:
parent
db2dc28f92
commit
b015fe88b7
4
deps/ox/src/ox/std/ranges.hpp
vendored
4
deps/ox/src/ox/std/ranges.hpp
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user