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. typedef typename K::Line_2 Line_2;
  8. typedef typename K::Point_2 Point_2;
  9.  
  10. Line_2 operator() (Point_2, Point_2) const
  11. {
  12. return Line_2();
  13. }
  14. };
  15.  
  16. template <class K> struct MyLess {
  17. typedef typename K::Point_2 Point_2;
  18.  
  19. bool operator() (Point_2, Point_2) const
  20. {
  21. return true;
  22. }
  23. };
  24.  
  25. template <class K>
  26. struct Kernel_base {
  27. typedef MyPoint<K> Point_2;
  28. typedef MyLine<K> Line_2;
  29. typedef MyConstruct<K> Construct_line_2;
  30. typedef MyLess<K> Less_xy_2;
  31. Construct_line_2 construct_line_2_object();
  32. Less_xy_2 less_xy_2_object();
  33. };
  34.  
  35. struct Kernel : public Kernel_base<Kernel> { };
  36.  
  37. // Generate new Kernel
  38. template <class K> struct NewPoint { };
  39. template <class K> struct MyLeftTurn { };
  40.  
  41. template<class K>
  42. struct New_kernel_base : public Kernel_base<K> {
  43. typedef NewPoint<K> Point_2;
  44. typedef MyLeftTurn<K> Left_turn_2;
  45. };
  46.  
  47. struct New_kernel : public New_kernel_base<New_kernel> {};
  48.  
  49. int main()
  50. {
  51. New_kernel::Point_2 p, q;
  52. New_kernel::Construct_line_2 construct_line_2;
  53. New_kernel::Line_2 l = construct_line_2(p, q);
  54. return 0;
  55. }
  56.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty