C++开发--在Visual Studio2013中使用boost::split()编译过程中出现error C4996

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

上一篇:RabbitMQ、Memcache、Redis RabbitMQ


下一篇:Android中的ListView的绘制过程中执行的方法