Comments (4)
OK, I did the first part, added gtl::vector
.
from gtl.
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.
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.
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)
- Possible undefined behavior (std::erase_if)? HOT 2
- Empty functions HOT 3
- Inconsistency gtl versions HOT 3
- multimap HOT 5
- Undefined behavior in phmap_utils.hpp HOT 1
- Proposal: Remove duplication of standard declarations HOT 4
- bazel support? HOT 1
- Benchmark HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtl.