问题
I wonder how to get the size of std::tr1::array<int, 16> >
?
is it just 16*sizeof(int)
, which is how 16 byte?
回答1:
Try sizeof(std::tr1::array<int, 16> >)
回答2:
Yes, std::tr1::array
is guaranteed to be an aggregate type that wraps the underlying raw array, which in fact you can access with the data()
member function. And the size of a raw array is the number of elements times the size of one element.
来源:https://stackoverflow.com/questions/11854477/whats-the-size-of-stdtr1arrayint-16