From 32fecea31f56368d42e4251a490b23e6c1a28e31 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Fri, 20 May 2011 15:58:28 +0000 Subject: [PATCH] Lazy_cartesian is an independent layer --- NewKernel_d/include/CGAL/Kernel_d/Lazy_cartesian.h | 8 +++++--- NewKernel_d/include/CGAL/store_kernel.h | 7 +++++-- NewKernel_d/test/NewKernel_d/test.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/NewKernel_d/include/CGAL/Kernel_d/Lazy_cartesian.h b/NewKernel_d/include/CGAL/Kernel_d/Lazy_cartesian.h index 378165fa1bc..ad6b6f14031 100644 --- a/NewKernel_d/include/CGAL/Kernel_d/Lazy_cartesian.h +++ b/NewKernel_d/include/CGAL/Kernel_d/Lazy_cartesian.h @@ -3,20 +3,22 @@ #include #include +#include #include #include namespace CGAL { - //TODO: ? use Lazy_cartesian instead of Kernel ? -template +template struct Lazy_cartesian : Dimension_base { //CGAL_CONSTEXPR Lazy_cartesian(){} //CGAL_CONSTEXPR Lazy_cartesian(int d):Base_(d){} //TODO: store an AK and an EK - typedef Lazy_cartesian Self; + typedef Lazy_cartesian Self; + //typedef typename Default::Get::type Kernel; + typedef Self Kernel; typedef AK_ Approximate_kernel; typedef EK_ Exact_kernel; typedef E2A_ E2A; diff --git a/NewKernel_d/include/CGAL/store_kernel.h b/NewKernel_d/include/CGAL/store_kernel.h index 38aac7bb2ed..7a96bde1c73 100644 --- a/NewKernel_d/include/CGAL/store_kernel.h +++ b/NewKernel_d/include/CGAL/store_kernel.h @@ -36,7 +36,7 @@ struct Store_kernel { Store_kernel(R_ const& r):rp(&r){} enum { kernel_is_stored = true }; R_ const& kernel()const{ - CGAL_warning_msg(rp==0,"I should know my kernel"); } + CGAL_warning_msg(rp==0,"I should know my kernel"); return *rp; } typedef R_ const& reference_type; @@ -62,7 +62,10 @@ struct Store_kernel2 { } Store_kernel2(R_ const& r):rp(&r){} enum { kernel2_is_stored = true }; - R_ const& kernel2()const{return *rp;} + R_ const& kernel2()const{ + CGAL_warning_msg(rp==0,"I should know my kernel"); + return *rp; + } typedef R_ const& reference2_type; void set_kernel2(R_ const&r){rp=&r;} private: diff --git a/NewKernel_d/test/NewKernel_d/test.cpp b/NewKernel_d/test/NewKernel_d/test.cpp index 332117e6b53..4c03fcb8168 100644 --- a/NewKernel_d/test/NewKernel_d/test.cpp +++ b/NewKernel_d/test/NewKernel_d/test.cpp @@ -39,7 +39,7 @@ typedef CGAL::Cartesian_filter_NT K2; #elif 0 typedef CGAL::Cartesian_filter_K K2; #elif 1 -struct K2: CGAL::Lazy_cartesian,K2>{}; +typedef CGAL::Lazy_cartesian > K2; #endif #if 0 typedef K2 K1;