Skip to content

const may not be correct afterall. #13

@Sebanisu

Description

@Sebanisu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions