From 4fd0e5ca31f96015855447582af7ad84303604f7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 2 Feb 2021 10:11:42 +0000 Subject: [PATCH] Add equal_to, minus, multiplies to CGAL::Kernel_d with a nested result_type --- Kernel_d/include/CGAL/Kernel_d/Iso_box_d.h | 39 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/Kernel_d/include/CGAL/Kernel_d/Iso_box_d.h b/Kernel_d/include/CGAL/Kernel_d/Iso_box_d.h index 3794119da67..addd748e2a6 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Iso_box_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Iso_box_d.h @@ -32,6 +32,39 @@ namespace CGAL { struct Begin {}; struct End {}; struct Cartesian_end {}; + + template + struct equal_to { + typedef bool result_type; + + bool operator()(const T &lhs, const T &rhs) const + { + return lhs == rhs; + } + + }; + + template + struct minus { + typedef bool result_type; + + T operator()(const T &lhs, const T &rhs) const + { + return lhs - rhs; + } + + }; + + template + struct multiplies { + typedef bool result_type; + + T operator()(const T &lhs, const T &rhs) const + { + return lhs * rhs; + } + + }; } // namespace Kernel_d template < typename Point_, typename Functor_ > @@ -277,11 +310,11 @@ namespace CGAL { RT volume_nominator() const { - typedef typename CIRT::template Iterator >::type + typedef typename CIRT::template Iterator >::type Iter; Iter b(ptr()->upper, ptr()->lower, Begin()); Iter e(ptr()->upper, ptr()->lower, Cartesian_end()); - return std::accumulate(b, e, RT(1), std::multiplies()); + return std::accumulate(b, e, RT(1), Kernel_d::multiplies()); } RT volume_denominator() const @@ -373,7 +406,7 @@ public: bool is_degenerate() const { typedef typename CIRT:: - template Iterator >::type Iter; + template Iterator >::type Iter; // omit homogenizing coordinates Iter e(ptr()->lower, ptr()->upper, Cartesian_end()); return