fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct a
  5. {
  6. friend void operator+(const a&, int);
  7. } A;
  8.  
  9.  
  10. void operator+(const a&, int)
  11. {
  12. cout << "ddd";
  13. }
  14.  
  15. struct c
  16. {
  17. operator a&() const noexcept
  18. {
  19. return A;
  20. }
  21. operator a() const noexcept
  22. {
  23. return A;
  24. }
  25. };
  26.  
  27.  
  28.  
  29. int main()
  30. {
  31. c C{};
  32. C + 1;
  33. return 0;
  34. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
ddd