fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo
  5. {
  6. Foo(int& some) : a(some), b(some) { }
  7.  
  8. int &a;
  9. int &b;
  10. };
  11.  
  12. int main() {
  13.  
  14. std::cout << "Expecting 1 if reference has no size and 8 if it has" << std::endl
  15. << sizeof(Foo) << std::endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
Expecting 1 if reference has no size and 8 if it has
8