Ivan Matek wrote:
I don't know much about library development, but with variadic templates does not seem so hard, although every library development is much harder than regular user code.
Sure boost::array probably wants to support ancient compilers, but variadic version could exist only for "modern"(I do not consider >10y old standards modern) C++.
I found this std:: proposal http://www.open- std.org/JTC1/SC22/WG21/docs/papers/2013/n3794.html#Ch05 from 9 y ago, also author seemed to have some working impl on github https://github.com/CTMacUser/ArrayMD/tree/master/include/boost/contain er
But I guess none of it ever progressed.
Does anybody knows more about this? It is not trivial since there are probably a ton of edge cases, typdefs, semantics(what should size return?, I would say array of dims) to deal with, but I think it would be a nice extension since I find nested std::array hideous (with current syntax), e.g.:
std::array<std::array<int,3>, 4> arr;
I would like to have this boost::array<int,4,3> arr;
boost::array<int[4], 3> should work, more or less. I've always felt that the syntax should have been array<int[3]> instead, which naturally extends to array<int[4][3]>, but it's too late now.