fork download
  1. #include <iostream>
  2.  
  3. int function(){
  4. return 3;
  5. }
  6.  
  7. class functor{
  8. public:
  9. int operator()(){
  10. return 2;
  11. }
  12. };
  13.  
  14. int main(){
  15. functor funtore;
  16. std::cout<<"funzione: "<<function()<<std::endl;
  17. std::cout<<"funtore: " <<funtore()<<std::endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
funzione: 3
funtore: 2