c++ - error C4146: unary minus operator applied to unsigned type, result still unsigned -
i try build crf++ in visual studio 2013 , error in last line:
array_[begin + siblings[i].code].base = value_ ? static_cast<array_type_>(-value_[siblings[i].left]-1) : static_cast<array_type_>(-siblings[i].left-1);
error c4146: unary minus operator applied unsigned type, result still unsigned
specifically, in darts.h, line 189.
i built again in visual studio 2015 there no error.
how can fix in visual studio 2013?
try this:
int tmp = static_cast<int>(siblings[i].left); array_[begin + siblings[i].code].base = value_ ? static_cast<array_type_>(-value_[siblings[i].left]-1) : static_cast<array_type_>(-tmp - 1);
Comments
Post a Comment