@@ -34,13 +34,12 @@ template <typename Type> class Weighted
3434 return value == other.value && weight == other.weight ;
3535 }
3636
37- template <typename Comparator =
38- std::conditional_t <std::floating_point<Type>,
39- decltype (Math::Floating::less),
40- std::less<Type>>>
4137 bool operator <(const Weighted<Type> &other) const
4238 {
43- return Comparator{}(value, other.value );
39+ using Less = std::conditional_t <std::floating_point<Type>,
40+ decltype (Math::Floating::less),
41+ std::less<Type>>;
42+ return Less{}(value, other.value );
4443 }
4544
4645 [[nodiscard]] bool hasValue () const { return weight > 0.0 ; }
@@ -224,28 +223,26 @@ template <typename Type> class Interpolated
224223 return res;
225224 }
226225
227- template <typename T = Type,
228- typename Cmp = std::conditional_t <std::floating_point<T>,
229- decltype (Math::Floating::less),
230- std::less<T>>>
231- [[nodiscard]] T min () const
226+ template <typename T = Type> [[nodiscard]] T min () const
232227 {
228+ using Less = std::conditional_t <std::floating_point<T>,
229+ decltype (Math::Floating::less),
230+ std::less<T>>;
233231 return !has_second ? this ->values [0 ].value
234232 : std::min (this ->values [0 ].value ,
235233 this ->values [1 ].value ,
236- Cmp {});
234+ Less {});
237235 }
238236
239- template <typename T = Type,
240- typename Cmp = std::conditional_t <std::floating_point<T>,
241- decltype (Math::Floating::less),
242- std::less<T>>>
243- [[nodiscard]] T max () const
237+ template <typename T = Type> [[nodiscard]] T max () const
244238 {
239+ using Less = std::conditional_t <std::floating_point<T>,
240+ decltype (Math::Floating::less),
241+ std::less<T>>;
245242 return !has_second ? this ->values [0 ].value
246243 : std::max (this ->values [0 ].value ,
247244 this ->values [1 ].value ,
248- Cmp {});
245+ Less {});
249246 }
250247};
251248
0 commit comments