Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9073287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:22:56+00:00 2026-06-16T18:22:56+00:00

Possible Duplicate: Why does calling boost:split() give so many warnings? So, this is my

  • 0

Possible Duplicate:
Why does calling boost:split() give so many warnings?

So, this is my code:

Account ParseString(string data){
    vector <string> fields;
    boost::split( fields, data, boost::is_any_of( "a,;" ));
    int limit = fields.size();
    for(int i = 0; i < limit; i++)
        cout << fields[i] << endl;
}

and this is what I get when trying to compile:

d:\program files (x86)\visualstudio\vc\include\xutility(2227): warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'

My question is, what have I done wrong? What can I do to prevent those error messages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:22:57+00:00Added an answer on June 16, 2026 at 6:22 pm

    You haven’t done anything wrong. 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[10] = {};
        int y[10] = {};
        int *a = x, *b = y;
        std::copy(a, a+10, 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How does this CSS triangle shape work? Please help me i need
Possible Duplicate: why does initializing subclasses require calling the super class's same init function?
Possible Duplicate: C++ virtual function from constructor Calling virtual functions inside constructors This question
Possible Duplicate: Javascript: Unicode string split by chars I have a javascript string which
Possible Duplicate: Does a huge amount of warnings make C# compile time longer? In
Possible Duplicate: does code in finally get run after a return in objective-c? Consider
Possible Duplicate: Does reading from stdin flush stdout? C++ Standard guarantees that all data
Possible Duplicate: new MyObject(); vs new MyObject; I keep seeing code like this one:
Possible Duplicate: Why does asynchronous delegate method require calling EndInvoke? Is Delegate.EndInvoke() really necessary?
Possible Duplicate: Calling a function from a string with the function's name in Python

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.