#include <iostream>
using namespace std;
template <typename T, std::size_t... Sizes>
class Foo {
public:
const std::size_t rank = (sizeof...(Sizes));
const std::size_t dimensions[sizeof...(Sizes)] = {Sizes...};
};
int main() {
Foo<int, 1, 2, 3> foo;
std::cout << "Rank: " << foo.rank << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHN0ZDo6c2l6ZV90Li4uIFNpemVzPgpjbGFzcyBGb28gewpwdWJsaWM6Cgljb25zdCBzdGQ6OnNpemVfdCByYW5rID0gKHNpemVvZi4uLihTaXplcykpOwoJY29uc3Qgc3RkOjpzaXplX3QgZGltZW5zaW9uc1tzaXplb2YuLi4oU2l6ZXMpXSA9IHtTaXplcy4uLn07Cn07CgppbnQgbWFpbigpIHsKCQoJRm9vPGludCwgMSwgMiwgMz4gZm9vOwoJCglzdGQ6OmNvdXQgPDwgIlJhbms6ICIgPDwgZm9vLnJhbmsgPDwgc3RkOjplbmRsOwoJCglyZXR1cm4gMDsKfQ==