On 10/15/2016 1:48 PM, Andreas Schäfer wrote:
On 12:02 Sat 15 Oct , Michael Marcin wrote:
Looks to only work for homogeneous data
Could you clarify what you mean by "homogeneous data"? Do you refer to structures where all members have the same type? In LibFlatArray all member fields of an SoA may have different types. This example[1] has a member of type bool and one of type double. You can also have arrays (e.g. int foo[3]) as members (e.g. [2]).
Ah I was looking at soa_array.hpp and didn't see anything that looked like it could handle multiple data types. My apologies.
and looks to not handle alignment.
Alignment for the allocated memory is handled by the allocator. The aligned_allocator[3] can also be used with std containers (e.g. std::vector). For 2D and 3D grids the soa_grid container will pad the grid dimensions internally to ensure alignment.
I see, I was looking for alignof or similar constructs which would align each subarray. But I couldn't find anything.
Otherwise looks quite similar to what I described. Thanks for the link.
HTH :-)
When the docs say: "For each member a sub-array is reserved within. We know each member's size and the array's dimensions are fixed, thus we can deduce the offsets for each of these sub-arrays.? Does this mean the AoS has a compile-time fixed capacity? I was imagining a std::vector-like dynamic capacity with amortized growth.