Visual Studio is being overly cautious. In debug mode, visual studio uses something called "Checked Iterators". Pointers are also iterators, but the checking mechanism doesn't work with them. So when a standard library algorithm is called with pointers, which is something that boost::split
does, it issues this warning.
You'll get the same warning with this obviously safe code:
int main()
{
int x[] = {};
int y[] = {};
int *a = x, *b = y;
std::copy(a, a+, b);
}
Disable the warning. It's for beginners. It's on by default for the safety of beginners, because if it was off by default, they wouldn't know how to turn it on.
Add -D_SCL_SECURE_NO_WARNINGS
to the command line. In the IDE, you can go to "Project -> Properties -> C/C++ -> Command Line" and add it in the additional options field.
ref:http://*.com/questions/14141476/warning-with-boostsplit-when-compiling