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,803
  • 19
  • 28
weeo
  • 2,461
  • 4
  • 19
  • 27

2 Answers2

5

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

Gordon Bailey
  • 3,803
  • 19
  • 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
  • 447,451
  • 88
  • 851
  • 1,056