fork download
  1. #include <iostream>
  2.  
  3. template <class ParamType>
  4. struct IsGood
  5. {
  6. typedef bool (*Check)(const ParamType, int other);
  7. };
  8.  
  9. template< typename ParamType >
  10. void DoSmth(typename IsGood<ParamType>::Check isGood, const ParamType param)
  11. {
  12. if(isGood(param, 5))
  13. std::cout << "good";
  14. }
  15.  
  16. bool checkEqualInt(int i, int j){return i==j;}
  17.  
  18. int main()
  19. {
  20. DoSmth(checkEqualInt, 5);
  21. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
good