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

ReverseIterator.prev() does not point the previous iterator. #26

Closed
samchon opened this issue Dec 10, 2018 · 1 comment
Closed

ReverseIterator.prev() does not point the previous iterator. #26

samchon opened this issue Dec 10, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@samchon
Copy link
Owner

samchon commented Dec 10, 2018

Summary

  • TSTL Version: 2.0.14
  • Expected behavior: Points the previous iterator.
  • Actual behavior: Points the next one.

Code occuring the bug

import * as std from "tstl";

function main(): void
{
    let v: std.Vector<number> = new std.Vector([0, 1, 2, 3, 4]);
    let it: std.Vector.ReverseIterator<number> = v.rbegin().advance(2);

    console.log(it.prev().value, it.advance(-1).value); // 1 3 -> Incorrect, must be 3 3
    console.log(it.next().value, it.advance(+1).value); // 1 1 -> Exact
}
main();
@samchon samchon added the bug Something isn't working label Dec 10, 2018
@samchon
Copy link
Owner Author

samchon commented Dec 10, 2018

Fixed in v2.0.15 & v2.1.0-dev.20181210 updates

@samchon samchon closed this as completed Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant