1

I wonder how to get the size of std::tr1::array<int, 16> >?

is it just 16*sizeof(int), which is how 16 byte?

Gordon Bailey
  • 3,881
  • 20
  • 28
weeo
  • 2,619
  • 5
  • 20
  • 29

2 Answers2

5

Try sizeof(std::tr1::array<int, 16> >)

Gordon Bailey
  • 3,881
  • 20
  • 28
3

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.

Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084