Skip to content

Commit

Permalink
add coercion from unsigned (for CGAL::centroid)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrineau committed Mar 29, 2024
1 parent f46dea7 commit 59ae933
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Number_types/include/CGAL/Filtered_rational.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <CGAL/Exact_rational.h>
#include <CGAL/Interval_nt.h>
#include <CGAL/Algebraic_structure_traits.h>
#include <CGAL/Lazy_exact_nt.h>

namespace CGAL {

Expand Down Expand Up @@ -37,6 +38,10 @@ struct Filtered_rational : boost::totally_ordered1<Filtered_rational
: i(d), rat(d)
{}

Filtered_rational(unsigned int d)
: i(d), rat(d)
{}

Filtered_rational(double d)
: i(d), rat(d)
{}
Expand Down Expand Up @@ -185,6 +190,7 @@ bool operator<(const Filtered_rational& a,
}
}
CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(Filtered_rational)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(unsigned ,Filtered_rational)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int ,Filtered_rational)
CGAL_DEFINE_COERCION_TRAITS_FROM_TO(double ,Filtered_rational)

Expand Down

0 comments on commit 59ae933

Please sign in to comment.