Given a hana::tuple
specifying the shape of a N-dimensional box, (e.g. (2,3,2)
in 3D
) at compile time, I would like to generate a tuple of tuples with all coordinate combinations at compile time.
(0,0,0)
(0,0,1)
(0,1,0)
(0,1,1)
(0,2,0)
(0,2,1)
(1,0,0)
(1,0,1)
(1,1,0)
(1,1,1)
(1,2,0)
(1,2,1)
The question is related to another one I posted a few days ago (link) but reformulated for hana
. I seem to have trouble coming up with an algorithm which respects the immutability of the hana::tuple
object. I fail to recognize what combination of hana
algorithms will allow me to generate a recursive call and also collect the returned tuples at the same time.