You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling discrete_distribution using MSVC 2010 64-bit compiler, warnings are emitted.
The key warning says:
warning C4267: 'argument' : conversion from 'size_t' to 'int32_t', possible loss of data
Cause of the issue:
In random/discrete_distribution.hpp, at line 507, the expression _impl.get_weight(i) tries to convert 'i' (a 'size_t') into 'IntType' (the parameter type of get_weight()).
However, 'IntType' is 'int' by default, which causes a conversion from 64-bit to 32-bit in a 64-bit environment.
Suggestions:
At line 499, 'i' is defined as a 'size_t'.
It should be safe to define it as an 'IntType': IntType i = 0;.
The text was updated successfully, but these errors were encountered:
When compiling discrete_distribution using MSVC 2010 64-bit compiler, warnings are emitted.
The key warning says:
warning C4267: 'argument' : conversion from 'size_t' to 'int32_t', possible loss of data
Cause of the issue:
In random/discrete_distribution.hpp, at line 507, the expression
_impl.get_weight(i)
tries to convert 'i' (a 'size_t') into 'IntType' (the parameter type ofget_weight()
).However, 'IntType' is 'int' by default, which causes a conversion from 64-bit to 32-bit in a 64-bit environment.
Suggestions:
At line 499, 'i' is defined as a 'size_t'.
It should be safe to define it as an 'IntType':
IntType i = 0;
.The text was updated successfully, but these errors were encountered: