fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class K> struct MyPoint { };
  5. template <class K> struct MyLine { };
  6. template <class K> struct MyConstruct { };
  7. template <class K> struct MyLess { };
  8.  
  9. struct Kernel {
  10. typedef MyPoint<Kernel> Point_2;
  11. typedef MyLine<Kernel> Line_2;
  12. typedef MyConstruct<Kernel> Construct_line_2;
  13. typedef MyLess<Kernel> Less_xy_2;
  14. };
  15.  
  16. // Generate new Kernel
  17. template <class K> struct NewPoint { };
  18. template <class K> struct MyLeftTurn { };
  19. struct New_kernel : public Kernel {
  20. typedef NewPoint<New_kernel> Point_2;
  21. typedef MyLeftTurn<New_kernel> Left_turn_2;
  22. };
  23.  
  24. int main()
  25. {
  26. New_kernel::Point_2 p, q;
  27. New_kernel::Construct_line_2 construct_line_2;
  28. New_kernel::Line_2 l = construct_line_2(p, q);
  29. return 0;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:28:49: error: no match for call to ‘(Kernel::Construct_line_2 {aka MyConstruct<Kernel>}) (New_kernel::Point_2&, New_kernel::Point_2&)’
     New_kernel::Line_2 l = construct_line_2(p, q);
                                                 ^
stdout
Standard output is empty