References: Implicit conversion, What is size_t? and this post.
As documentation says:
Implicit conversions are automatically performed when a value is
copied to a compatible type.
In your case, trying int to size_t is also an implicit conversion. The reason why the warning mentions about the precision:
- size_t is always able to store more numbers than int.
- While size_t holds always a positive value, int can hold also negatives.
According to these two differences between size_t and int, program assumes that some problems or precision loses can occur in the future.
In your case, you can simply convert your size_t type using static_cast conversion:
static_cast<int>(your_size_t_type_parameter)
Note: Using this method can eliminate your warning but this can cause some loses. For example if your size_t value is very huge.