The following if statements should be if constexpr in C++17 and above:
| if (std::is_integral<OutT>::value) { |
| if (!std::is_same<T,bool>::value && std::is_integral<T>::value) { |
| if (std::is_floating_point<T>::value) { |
| if (sizeof(in_value) >sizeof(double)) { |
| }elseif (sizeof(in_value) >sizeof(float)) { |
and not as trivial but constexpr parts from the following if statements should be extracted in separate if constexpr statements:
| if (std::is_integral<T>::value && std::is_floating_point<OutT>::value && |
| }elseif (std::is_floating_point<T>::value && |
This way compiler warnings like
WarningC4804'<': unsafe use of type 'bool' in operation
can be avoided in line
| if (in_value <kOutMin || in_value > std::numeric_limits<OutT>::max()) { |
In template bool ConvertValue(AttributeValueIndex att_id, int8_t out_num_components, OutT *out_val) const
there is a long switch that "calls"/instantiates ConvertTypedValue<bool, OutT> that in turn "calls"
ConvertComponentValue<bool, OutT> that causes the warning for ConvertComponentValue<bool, float> because language requirements.