fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Bar
  5. {
  6. char data[64];
  7. };
  8.  
  9. struct Foo
  10. {
  11. Foo(Bar& some) : a(some), b(some) { }
  12.  
  13. Bar &a;
  14. Bar &b;
  15. };
  16.  
  17. int main() {
  18. Bar bar;
  19. std::cout << sizeof(bar) << std::endl;
  20.  
  21. Bar &bar_ref = bar;
  22. std::cout << sizeof(bar_ref) << std::endl;
  23.  
  24. std::cout << sizeof(Foo) << std::endl;
  25. return 0;
  26. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
64
64
8