mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
fix polymorphic functor
This commit is contained in:
parent
ac5ac257e6
commit
53b99b25f8
9 changed files with 60 additions and 47 deletions
|
@ -74,15 +74,24 @@ namespace sprout {
|
|||
//
|
||||
// lcm_evaluator
|
||||
//
|
||||
template<typename IntType>
|
||||
template<typename IntType = void>
|
||||
class lcm_evaluator {
|
||||
public:
|
||||
typedef IntType result_type;
|
||||
typedef IntType first_argument_type;
|
||||
typedef IntType second_argument_type;
|
||||
public:
|
||||
SPROUT_CONSTEXPR result_type
|
||||
operator()(first_argument_type const& a, second_argument_type const& b) const {
|
||||
SPROUT_CONSTEXPR IntType
|
||||
operator()(IntType const& a, IntType const& b) const {
|
||||
return sprout::math::detail::lcm_optimal(a, b);
|
||||
}
|
||||
};
|
||||
template<>
|
||||
class lcm_evaluator<void> {
|
||||
public:
|
||||
template<typename IntType>
|
||||
SPROUT_CONSTEXPR IntType
|
||||
operator()(IntType const& a, IntType const& b) const {
|
||||
return sprout::math::detail::lcm_optimal(a, b);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue