fork download
  1. #include <iostream>
  2.  
  3. struct functor
  4. {
  5. template<class T> void operator()(T value) // (*)
  6. {
  7. std::cout << "general";
  8. }
  9. template<class T> void operator()(T* value) // (**)
  10. {
  11. std::cout << "special";
  12. }
  13. };
  14.  
  15. int main() {
  16. functor a;
  17. char* b;
  18. a(b);
  19. }
  20.  
Success #stdin #stdout 0s 2828KB
stdin
Standard input is empty
stdout
special