Skip to content

Investigate and introduce mutability and copy-ability of Ranges items #55

@k06a

Description

@k06a

We need Ranges to allow modification items during enumeration. We need to investigate can this be achieved in the same syntax:

from(items).for_each([](Human & human){human.age += 1;})

or requires different constructors like:

mut_from(items).for_each([](Human & human){human.age += 1;})

The same question about unexpectedly producing copies - this should not happen actually. Or maybe we need a separate constructor for this:

int total = 0;
copy_from(items).for_each([](Human human){total += human.age;})

Plan:

  1. Checkout these issues: Non-copyable types of elements are not supported #22, copy assgin  #44
  2. I started experimenting with this here a while ago: Add test for unique_ptr #29
  3. Propose the best solution :)

Investigate and propose solution to make the library extremely useful. Prefer implicit over explicit mutability and copy-ability specification.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions