@@ -34,13 +34,12 @@ template <typename Type> class Weighted
34
34
return value == other.value && weight == other.weight ;
35
35
}
36
36
37
- template <typename Comparator =
38
- std::conditional_t <std::floating_point<Type>,
39
- decltype (Math::Floating::less),
40
- std::less<Type>>>
41
37
bool operator <(const Weighted<Type> &other) const
42
38
{
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 );
44
43
}
45
44
46
45
[[nodiscard]] bool hasValue () const { return weight > 0.0 ; }
@@ -224,28 +223,26 @@ template <typename Type> class Interpolated
224
223
return res;
225
224
}
226
225
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
232
227
{
228
+ using Less = std::conditional_t <std::floating_point<T>,
229
+ decltype (Math::Floating::less),
230
+ std::less<T>>;
233
231
return !has_second ? this ->values [0 ].value
234
232
: std::min (this ->values [0 ].value ,
235
233
this ->values [1 ].value ,
236
- Cmp {});
234
+ Less {});
237
235
}
238
236
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
244
238
{
239
+ using Less = std::conditional_t <std::floating_point<T>,
240
+ decltype (Math::Floating::less),
241
+ std::less<T>>;
245
242
return !has_second ? this ->values [0 ].value
246
243
: std::max (this ->values [0 ].value ,
247
244
this ->values [1 ].value ,
248
- Cmp {});
245
+ Less {});
249
246
}
250
247
};
251
248
0 commit comments