fork download
  1. #include <cassert>
  2. #include <cstddef>
  3. #include <iostream>
  4.  
  5.  
  6.  
  7. int main()
  8. {
  9. // Case 1: the new object failed to be transparently replaceable because
  10. // it is a base subobject but the old object is a complete object.
  11. int a = 5;
  12. int b = 9;
  13. bool res = false;
  14. const int &x = a;
  15. const int &c = res*a + !res*b;
  16. b++;
  17. std::cout<<a<<" "<<b<<" "<<x<<" "<<c<<std::endl;
  18. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
5 10 5 9