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. template <class K>
  10. struct Kernel_base {
  11. typedef MyPoint<K> Point_2;
  12. typedef MyLine<K> Line_2;
  13. typedef MyConstruct<K> Construct_line_2;
  14. typedef MyLess<K> Less_xy_2;
  15. };
  16.  
  17. struct Kernel : public Kernel_base<Kernel> { };
  18.  
  19. // Generate new Kernel
  20. template <class K> struct NewPoint { };
  21. template <class K> struct MyLeftTurn { };
  22.  
  23. template<class K>
  24. struct New_kernel_base : public Kernel_base<K> {
  25. typedef NewPoint<K> Point_2;
  26. typedef MyLeftTurn<K> Left_turn_2;
  27. };
  28.  
  29. struct New_kernel : public New_kernel_base<New_kernel> {};
  30.  
  31. int main()
  32. {
  33. New_kernel::Point_2 p, q;
  34. New_kernel::Construct_line_2 construct_line_2;
  35. New_kernel::Line_2 l = construct_line_2(p, q);
  36. return 0;
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:35:49: error: no match for call to ‘(Kernel_base<New_kernel>::Construct_line_2 {aka MyConstruct<New_kernel>}) (New_kernel_base<New_kernel>::Point_2&, New_kernel_base<New_kernel>::Point_2&)’
     New_kernel::Line_2 l = construct_line_2(p, q);
                                                 ^
stdout
Standard output is empty