Giter VIP home page Giter VIP logo

Comments (4)

greg7mdp avatar greg7mdp commented on June 9, 2024 1

OK, I did the first part, added gtl::vector.

from gtl.

greg7mdp avatar greg7mdp commented on June 9, 2024

Thanks for the kind words!

have the ability to "steal" the backing array from the flat-maps (after compacting them into a "normal" array first of course.)

Should not be too difficult to do. Let me look into it.

from gtl.

greg7mdp avatar greg7mdp commented on June 9, 2024

Hum, there is the issue of the allocator used for allocating the array inside the flat_hash_set. If you steal the buffer, then you also need to use the same allocator to free the memory buffer eventually. I wish there was a way to construct a std::vector from a pointer, size, capacity and optional allocator. I don't want to implement my own gtl::vector.

But it would be nice, we could have a gtl::vector which could be constructed using:

vector::vector(gtl::flat_hash_set&&);

and that move constructor would steal the underlying array (after compaction).

from gtl.

yonik avatar yonik commented on June 9, 2024

Hum, there is the issue of the allocator used for allocating the array inside the flat_hash_set

Yeah, I figured it could be a super-low-level expert method where the caller may even be in charge of calling individual destructors (making it possible is better than nothing at all IMO). Either that, or as you suggest, your own little vector-like class.

from gtl.

Related Issues (9)

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.