File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -225,8 +225,9 @@ inline double n_choose_k(int n, int k) {
225225 * For example, the minimum of NaN and 1 must be NaN independently of the argument order.
226226 * See 'Not a number' section at https://2pi.dk/2016/05/ieee-min-max
227227 */
228- template <typename T, class = typename std::enable_if<!std::is_integral<T>::value>::type >
228+ template <typename T>
229229inline const T minnan (const T& a, const T& b) {
230+ static_assert (!std::is_integral<T>::value, " minnan() is only meant for doubles and double based units, use std::min() for integers" );
230231 if (a < b)
231232 return a;
232233 else if (b < a)
@@ -242,8 +243,9 @@ inline const T minnan(const T& a, const T& b) {
242243 * For example, the maximum of NaN and 1 must be NaN independently of the argument order.
243244 * See 'Not a number' section at https://2pi.dk/2016/05/ieee-min-max
244245 */
245- template <typename T, class = typename std::enable_if<!std::is_integral<T>::value>::type >
246+ template <typename T>
246247inline const T maxnan (const T& a, const T& b) {
248+ static_assert (!std::is_integral<T>::value, " maxnan() is only meant for doubles and double based units, use std::max() for integers" );
247249 if (a > b)
248250 return a;
249251 else if (b > a)
You can’t perform that action at this time.
0 commit comments