Loading src/core/utils/unit.tpp +7 −9 Original line number Diff line number Diff line Loading @@ -27,17 +27,15 @@ namespace allpix { out < static_cast<UnitType>(std::numeric_limits<T>::lowest())) { throw std::overflow_error("unit conversion overflows the type"); } if constexpr(!std::is_integral_v<T>) { return static_cast<T>(out); } else { // If the input is an integral value: check so that it doesn't have decimals after applying the unit if constexpr(std::is_integral_v<T>) { // If the input is an integral value: check so that it doesn't have decimals after applying the unit if(out != static_cast<T>(out)) { throw LogicError("Cannot use integer value with non-integer internal unit; the combination " + std::to_string(inp) + " " + str + " is invalid."); } return static_cast<T>(out); } } else { return static_cast<T>(out); } } Loading Loading
src/core/utils/unit.tpp +7 −9 Original line number Diff line number Diff line Loading @@ -27,17 +27,15 @@ namespace allpix { out < static_cast<UnitType>(std::numeric_limits<T>::lowest())) { throw std::overflow_error("unit conversion overflows the type"); } if constexpr(!std::is_integral_v<T>) { return static_cast<T>(out); } else { // If the input is an integral value: check so that it doesn't have decimals after applying the unit if constexpr(std::is_integral_v<T>) { // If the input is an integral value: check so that it doesn't have decimals after applying the unit if(out != static_cast<T>(out)) { throw LogicError("Cannot use integer value with non-integer internal unit; the combination " + std::to_string(inp) + " " + str + " is invalid."); } return static_cast<T>(out); } } else { return static_cast<T>(out); } } Loading