Skip to content

const may not be correct afterall. #13

Open

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.

Activity

  1. added a commit that references this issue on Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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