Boost logo

Boost :

From: Ivan Matek (libbooze_at_[hidden])
Date: 2022-01-02 08:40:07


Answering multiple people in one mail to prevent me spamming this topic,
let me know if prefer multiple mails

@ Andrzej
Sometimes I need the multidim array of statically known dims and I find
Eigen or some of boost stuff you suggested an overkill for such basic
functionality.
This is philosophical claim(what is an overkill) and not something
measurable, but I do feel that way.

@Andrey
I believe you are right, seems too complex, shame, although I believe it
might possible to hack the array to be recursively defined, but for some
reason agg initialization does not seem to work... :/
https://godbolt.org/z/Pzrbh49WK
There is probably a ton of other issues, once again C++ turns out to be
much harder than I assumed. :(
But at least you can see API I would like to see.

@pdimov
I agree with your original idea, but we are where we are and I prefer not
to mix existing boost/std::array and C array syntax. It just looks horrible
for me, in same way that std::vector<std::string> and vector<string> are
fine, but
I cant hate std::vector<string> or vector<std::string> :)

@John
In godbolt link above you can see what I would like to see for basic API,
basically struct containing N-1 dim array of itself unless we are at 1D
level, then obviously we contain array of T.
As mentioned I am not some C++ expert, but this is the most natural thing I
could think of.

@Robert
I think multi_array is still heap allocating, but unlike vector<vector> it
does one heap allocation so it is more efficient.

to recap:
if somebody thinks this is possible and is interested in working on this
please let me know I would be happy to work on this, but I think this is
out my capabilities to do on my own. :/ :)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk