Skip to content

Commit

Permalink
cppad: Fix build with Boost < 1.77
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Jan 15, 2024
1 parent a803a37 commit d0176ff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/pinocchio/autodiff/cppad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ namespace boost
return ADScalar(constant_pi<Scalar>::get(n));
}

#if BOOST_VERSION >= 107700
template <class T, T value>
static inline ADScalar get(const std::integral_constant<T, value> &n)
{
return ADScalar(constant_pi<Scalar>::get(n));
}
#else
template <class T, T value>
static inline ADScalar get(const boost::integral_constant<T, value> &n)
{
return ADScalar(constant_pi<Scalar>::get(n));
}
#endif
};
}
}
Expand Down
8 changes: 8 additions & 0 deletions include/pinocchio/codegen/cppadcg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ namespace boost
return CGScalar(constant_pi<Scalar>::get(n));
}

#if BOOST_VERSION >= 107700
template <class T, T value>
static inline CGScalar get(const std::integral_constant<T, value> &n)
{
return CGScalar(constant_pi<Scalar>::get(n));
}
#else
template <class T, T value>
static inline CGScalar get(const boost::integral_constant<T, value> &n)
{
return CGScalar(constant_pi<Scalar>::get(n));
}
#endif
};
}
}
Expand Down

0 comments on commit d0176ff

Please sign in to comment.