#include <iostream>
using namespace std;

template <class K> struct MyPoint { };
template <class K> struct MyLine { };
template <class K> struct MyConstruct { 
    typedef typename K::Line_2 Line_2;
    typedef typename K::Point_2 Point_2;

    Line_2 operator() (Point_2, Point_2) const
    {
        return Line_2();
    }
};

template <class K> struct MyLess {
    typedef typename K::Point_2 Point_2;

    bool operator() (Point_2, Point_2) const
    {
        return true;
    }
};

template <class K>
struct Kernel_base {
    typedef MyPoint<K> Point_2;
    typedef MyLine<K> Line_2;
    typedef MyConstruct<K> Construct_line_2;
    typedef MyLess<K> Less_xy_2;
    Construct_line_2 construct_line_2_object();
    Less_xy_2        less_xy_2_object();
};

struct Kernel : public Kernel_base<Kernel> { };

// Generate new Kernel
template <class K> struct NewPoint { };
template <class K> struct MyLeftTurn { };

template<class K>
struct New_kernel_base : public Kernel_base<K> {
    typedef NewPoint<K> Point_2;
    typedef MyLeftTurn<K> Left_turn_2;
};

struct New_kernel : public New_kernel_base<New_kernel> {};

int main()
{
    New_kernel::Point_2 p, q;
    New_kernel::Construct_line_2 construct_line_2;
    New_kernel::Line_2 l = construct_line_2(p, q);
    return 0;
}
