New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error c4996 in MSVC #945
Comments
This warning was preventing the application from being built in release mode with Visual Studio 16.5. Somebody else has filed an issue for this in the sol2 repository at ThePhD/sol2#945, so the changes made here can be removed once that issue is fixed.
We don't use I don't get this error either, with a naked build in a fresh Visuual Studio 2017 or 2019 project. Are you using an old version of sol2? They might have |
I use 3.2.0 version. I supress this error, so this error is not critical. |
Alright. If you can give a more detailed report about what is causing this error next time, if it comes up again, do let me know. |
In 3.2.0 in file table_iterator.hpp class basic_table_iterator inherited by std::iterator which deprecated in C++17 class basic_table_iterator : public std::iterator<std::input_iterator_tag, std::pair<object, object>> |
In visual studio 2019 16.5 compiller tell the std::iterator class template is deprecated in C++17
Error C4996 'std::iterator<std::input_iterator_tag,std::pairsol::object,sol::object,ptrdiff_t,std::pairsol::object,sol::object *,std::pairsol::object,sol::object &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
The text was updated successfully, but these errors were encountered: