3 ms·
This definitely has my attention...I like that you parameterized the underlying storage. Dislike the dependency on boost :( Not having to have an extra code g
by chrsig 4y ago
This definitely has my attention...I like that you parameterized the underlying storage. Dislike the dependency on boost :(
Not having to have an extra code generation step is definitely nice though.
The SoA -> AoS difficulty has driven me to julia for my personal projects, there's a library called StructArrays.jl[0] that is quite similar to your project here.
[0] https://github.com/JuliaArrays/StructArrays.jl https://github.com/JuliaArrays/StructArrays.jl
- jcelerier 4y agoThe dependency on boost is not mandatory: - Either you can use standalone PFR (it does not really change anything as it's almost exactly the same code, just outside of namespace boost) but apparently that is an issue ahah - Or you can lobby the committee to accept P1061 ; there's already a compiler implementation based on clang-12: https://github.com/ricejasonf/llvm-project/tree/ricejasonf/p1061 https://github.com/ricejasonf/llvm-project/tree/ricejasonf/p... With it, the code becomes even simpler and would not need PFR at all ; a function such as std::size_t create() { [&]<std::size_t... N>(std::index_sequence<N...>) { (std::get<N>(vec).push_back({}), ...); } (indices{}); return size() - 1; } just becomes std::size_t create() { auto& [... v] = vec; ((v.push_back({}), ...); return size() - 1; }