Possible Duplicate:
Use templates to get an array's size and end addressCan someone explain this template code that gives me the size of an array? (the first answer includes obtaining the value as a compile time constant)
How to get size of an array using metaprogramming? Multidimensional would be also appreciated. So for example if I pass a type to this struct (how ever it's called, let's say get_dim) I would get:
get_dim<int>::value; //0
get_dim<int[1]>::value //1
get_dim<int[2][3]>::value //2,3