鉴于此结构:
struct Foo {
std::array<int, 8> bar;
};
如果我没有 Foo
的实例,如何获取 bar
数组的元素数?
最佳答案
您可以使用 std::tuple_size
:
std::tuple_size<decltype(Foo::bar)>::value
关于c++ - 在没有实例的情况下获取 std::array 的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41345182/