fork download
  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4. using std::ostream;
  5.  
  6. struct myValue {
  7. int value;
  8. };
  9.  
  10. myValue BaseFunction(const int x) {
  11. return myValue{x};
  12. }
  13.  
  14. ostream& operator<<(ostream &os, const myValue &v) {
  15. return os << v.value;
  16. }
  17.  
  18. int main(int argc, char *argv[]) {
  19. cout << BaseFunction(3) << endl;
  20. }
Success #stdin #stdout 0s 4236KB
stdin
Standard input is empty
stdout
3