Fehler mit boost und VC++2015: boost::split(vector<string>, str, boost::is_any_of(" "));



  • Ich bekomme mit boost 1.58.0 und VC++2015 bei folgender Zeile einen Fehler:

    vector<string> my_vec;
    boost::split(my_vec, str, boost::is_any_of(" "));
    

    Kann mir jemand helfen?

    Der Fehler ist:

    1>  Unknown compiler version - please run the configure tests and report the results
    1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility(2230): error 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'
    1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility(2216): note: see declaration of 'std::_Copy_impl'
    1>  c:\c++\boost_1_58_0\boost\algorithm\string\detail\classification.hpp(102): note: see reference to function template instantiation '_OutIt std::copy<const char*,char*>(_InIt,_InIt,_OutIt)' being compiled
    1>          with
    1>          [
    1>              _OutIt=char *,
    1>              _InIt=const char *
    1>          ]
    1>  c:\c++\boost_1_58_0\boost\algorithm\string\classification.hpp(206): note: see reference to function template instantiation 'boost::algorithm::detail::is_any_ofF<char>::is_any_ofF<boost::iterator_range<const char *>>(const RangeT &)' being compiled
    1>          with
    1>          [
    1>              RangeT=boost::iterator_range<const char *>
    1>          ]
    1>  c:\c++\boost_1_58_0\boost\algorithm\string\classification.hpp(206): note: see reference to function template instantiation 'boost::algorithm::detail::is_any_ofF<char>::is_any_ofF<boost::iterator_range<const char *>>(const RangeT &)' being compiled
    1>          with
    1>          [
    1>              RangeT=boost::iterator_range<const char *>
    1>          ]
    1>  c:\c++\komponist\komponist\komponist\stimme.cpp(20): note: see reference to function template instantiation 'boost::algorithm::detail::is_any_ofF<char> boost::algorithm::is_any_of<char[2]>(const RangeT (&))' being compiled
    1>          with
    1>          [
    1>              RangeT=char [2]
    1>          ]
    


  • Mit

    boost::algorithm::is_space
    

    schlägt es auch fehl. 😞



  • Ah, OK: Mit

    -D_SCL_SECURE_NO_WARNINGS
    

    zu den Compileroptionen klappt es! 🙂


Log in to reply