C++ Boost: what's the cause of this warning?

后端 未结 6 1835
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 04:16

I have a simple C++ with Boost like this:

#include 

int main()
{
  std::string latlonStr = \"hello,ergr()()rg(rg)\";
  boo         


        
6条回答
  •  旧时难觅i
    2020-12-03 04:46

    It is nothing to worry about. In the last few releases of MSVC, they've gone into full security-paranoia mode. std::copy issues this warning when it is used with raw pointers, because when used incorrectly, it can result in buffer overflows.

    Their iterator implementation performs bounds checking to ensure this doesn't happen, at a significant performance cost.

    So feel free to ignore the warning. It doesn't mean there's anything wrong with your code. It is just saying that if there is something wrong with your code, then bad things will happen. Which is an odd thing to issue warnings about. ;)

提交回复
热议问题