Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to hasSlicing #854

Merged
merged 9 commits into from Dec 18, 2012
Merged

Improvements to hasSlicing #854

merged 9 commits into from Dec 18, 2012

Commits on Dec 17, 2012

  1. Revert "Fix std.range.takeExactly trait to reject slices without le…

    …ngth."
    
    This reverts commit 6a0b6c4.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    f8f2a81 View commit details
    Browse the repository at this point in the history
  2. Adjustments to take and takeExactly.

    takeExactly now returns the same type as take where possible, and
    neither take nor takeExactly check hasSlicing for infinite ranges (since
    infinite ranges will soon be required to use them for slicing, and that
    creates a circular dependency among those 3 templates
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    24a696a View commit details
    Browse the repository at this point in the history
  3. Some whitespace cleanup.

    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    7d5d9fb View commit details
    Browse the repository at this point in the history
  4. Adustments to hasSlicing.

    Now, it enforces that opSlice returns a range which can be assigned to
    the original range type (so that it can be assigned to the original
    range as long as the original range isn't const) as long as it's finite,
    and it enforces that opSlice's result is the result of take when the
    range is infinite.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    0d9b31b View commit details
    Browse the repository at this point in the history
  5. Fix to Map caused by changes to hasSlicing.

    import std.algorithm;
    import std.range;
    
    void main()
    {
        auto N2 = sequence!"n"(cast(size_t)1).map!"a";
    }
    
    ceased to compile, because Map's opSlice won't work anymore over
    infinite ranges, because the result can't be reassigned to the original.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    57ddea7 View commit details
    Browse the repository at this point in the history
  6. Add some requirements for opDollar to hasSlicing.

    Ideally, opDollar would be outright required for any range with slicing,
    but unless/until it's changed so that length automatically aliases to
    opDollar when opDollar isn't defined (issue# 7177), that's probably not
    a reasonable requirement to make.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    a0b82a5 View commit details
    Browse the repository at this point in the history
  7. Further strengthen hasSlicing.

    The extra requirements are not currently enabled because of bug# 8847,
    but they're now there, and they're listed as their in the documentation
    so that no one will think that they're not supposed to apply.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    6022082 View commit details
    Browse the repository at this point in the history
  8. Strengthened isRandomAccess with regards to $.

    It now requires that indexing with $ result in the same type as front if
    r[$] works, and if that works, and the range isn't infinite, r[$ - 1]
    must be the same type as front. Ideally, we'd require that r[$] work
    regardless, but without enhancement dlang#7177 being implemented, that would
    likely break too much code, as opDollar was only recently fixed and
    probably isn't used much.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    a916ad8 View commit details
    Browse the repository at this point in the history
  9. Removed incorrect @Property attributes in std.range.

    They were removed previously but reintroduced due to a bad rebase, so
    I'm removing them again here.
    jmdavis committed Dec 17, 2012
    Configuration menu
    Copy the full SHA
    68db081 View commit details
    Browse the repository at this point in the history