fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. void someFunction(int& value){
  6. std::cout << "ref" << std::endl;
  7. }
  8.  
  9. void someFunction(const int&& value){
  10. std::cout << "const" << std::endl;
  11. }
  12.  
  13. void someFunction(int&& value){
  14. std::cout << "non const" << std::endl;
  15. }
  16.  
  17. const int foo() { return int(); }
  18. int bar() { return int(); }
  19.  
  20.  
  21. int main() {
  22. someFunction(bar());
  23. someFunction(foo());
  24. return 0;
  25. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
non const
non const