You have done nothing wrong. Visual Studio is overly cautious. In debug mode, the visual studio uses something called Proven Iterators. Pointers are also iterators, but the validation mechanism does not work with them. Therefore, when the standard library algorithm is called with pointers, something that boost::split does, it generates this warning.
You will get the same warning with this explicitly safe code:
int main() { int x[10] = {}; int y[10] = {}; int *a = x, *b = y; std::copy(a, a+10, b); }
Disable the warning. This is for beginners. This is the default for beginner security, because if it is disabled by default, they donβt know how to enable it.
Benjamin lindley
source share