mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 17:26:51 +08:00
Silenced Visual Studio compiler warning
This code caused a C4127 "conditional expression is constant" compiler warning when compiled with Visual Studio at warning level 4 with T a signed integer type.
This commit is contained in:
parent
be9a8453c4
commit
d4d5748ec8
@ -482,7 +482,14 @@ parse_int_string(UC const *p, UC const *pend, T &value,
|
||||
UC const *const first = p;
|
||||
|
||||
bool const negative = (*p == UC('-'));
|
||||
#ifdef FASTFLOAT_VISUAL_STUDIO
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
if (!std::is_signed<T>::value && negative) {
|
||||
#ifdef FASTFLOAT_VISUAL_STUDIO
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
answer.ec = std::errc::invalid_argument;
|
||||
answer.ptr = first;
|
||||
return answer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user