Code Monkey home page Code Monkey logo

Comments (5)

mgaunard avatar mgaunard commented on May 29, 2024

Might also consider adding erase_and_dispose in boost intrusive style.

from ygg.

tinloaf avatar tinloaf commented on May 29, 2024

You are right. I added erasing by iterator in e073e63

I'm hesitant to also allow erasing by const_iterator - in an intrusive tree, erasure changes the underlying node, thus I would have to cast away constness there. Does this solve your problem?

from ygg.

mgaunard avatar mgaunard commented on May 29, 2024

erase should return the iterator to the next element

from ygg.

tinloaf avatar tinloaf commented on May 29, 2024

You are right - Ygg deviates from STL in this regard. Returning an iterator to the next element introduces a (small, but still…) performance penalty. Thus I'm reluctant to add that as a default.

I have added a TreeFlag named STL_ERASE which will make the erase() methods adhere to STL standards - returning an iterator to the next element, etc. See https://tinloaf.github.io/ygg/classygg_1_1RBTree.html#add5fdd34b982d1fc29be8051333219c2 for documentation. Never mind the weird return type - that's just the magic I use to switch between STL and non-STL version.

Does that help you?

from ygg.

tinloaf avatar tinloaf commented on May 29, 2024

I'll assume that the STL_ERASE option solved your problem. If you still experience problems, feel free to reopen this resp. create a new issue. Thanks for reporting!

from ygg.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.