fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <memory>
  4. #include <vector>
  5.  
  6. struct alignas(128) Foo
  7. {
  8. int x;
  9. };
  10.  
  11. int main()
  12. {
  13. Foo a[10];
  14. std::vector<Foo> b(10);
  15. std::cout << sizeof a << "\n"
  16. << sizeof(Foo) << "\n"
  17. << (reinterpret_cast<char*>(&*end(b)) - reinterpret_cast<char*>(&*begin(b))) << "\n"
  18. ;
  19. }
  20.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
1280
128
1280