|
find(P const pred, I f, I const l, Is... fs) { |
If the user is using a mutable lambda. Then they can't use the algorithm. So might need to remove const from these.
We might want to test a mutable lambda to see if it's working as expected. like [x=0] and ++x to make sure all the functions are correctly incrementing the value.
Though it should be fine I did some testing with compiler explorer. So I understand. The last function in the call will get the one that will increment because they are all pass by value.
|
any_of(P const pred, I f, I const l, Is... fs) { |
Here we could forward the value to find. It might be better since any_of isn't actually calling the lambda.
An-Algorithm-Library/src/aal/algorithm.hpp
Line 9 in 1a94a02
If the user is using a
mutablelambda. Then they can't use the algorithm. So might need to remove const from these.We might want to test a mutable lambda to see if it's working as expected. like
[x=0]and++xto make sure all the functions are correctly incrementing the value.Though it should be fine I did some testing with compiler explorer. So I understand. The last function in the call will get the one that will increment because they are all pass by value.
An-Algorithm-Library/src/aal/algorithm.hpp
Line 19 in 1a94a02