#include template < typename Value , unsigned... Lengths > struct array_recur ; template < typename Value , unsigned Length0 , unsigned... Lengths > struct array_recur < Value , Length0 , Lengths... > : boost::array < array_recur , Length0 > { }; template < typename Value , unsigned Length0 > struct array_recur < Value , Length0 > : boost::array < Value , Length0 > { }; int main() { array_recur a; a[0][0][0]=1; a[0][0][1]=2; a[1][1][1]=3; return a[0][0][0]+a[0][0][1]+a[1][1][1]; }