Skip to content

Commit

Permalink
int/rat dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Mar 15, 2024
1 parent 47b264e commit 5f89d09
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CGAL_Core/include/CGAL/CORE/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,14 @@ class Expr : public RCExpr {
Expr(const BigInt& I) : RCExpr(new ConstRealRep(Real(I))) {}
/// constructor for <tt>BigRat</tt>
Expr(const BigRat& R) : RCExpr(new ConstRealRep(Real(R))) {}
/// constructor for <tt>BigRat expression</tt>
template <class BigRatExpr, class = std::enable_if_t< boost::multiprecision::is_number_expression<BigRatExpr>::value> >
Expr(const BigRatExpr& R) : RCExpr(new ConstRealRep(Real(BigRat(R)))) {}
/// constructor from expression template
template <class TmplExpr,
class = std::enable_if_t<
boost::multiprecision::is_number_expression<TmplExpr>::value> >
Expr(const TmplExpr& R)
: RCExpr(new ConstRealRep(Real(
std::conditional_t<boost::multiprecision::number_category<TmplExpr>::value == boost::multiprecision::number_kind_integer,
BigInt, BigRat>(R)))) {}

/// constructor for <tt>BigFloat</tt>
Expr(const BigFloat& F) : RCExpr(new ConstRealRep(Real(F))) {}
Expand Down

0 comments on commit 5f89d09

Please sign in to comment.