fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class IComparable {
  5. public:
  6. virtual bool Equal(const IComparable&) = 0;
  7.  
  8. typedef int IsComparable;
  9. };
  10.  
  11. class Foo : public IComparable {
  12. public: bool Equal(const IComparable&) {
  13. return true;
  14. }
  15. };
  16.  
  17. template <typename Comparable>
  18. void compare(const Comparable& cmp, const Comparable& cmp2) {
  19. typedef typename Comparable::IsComparable Guard;
  20. }
  21.  
  22. int main() {
  23. Foo f;
  24. compare(f, f);
  25. //compare(10, 20);
  26. return 0;
  27. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty