Skip to content
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

Closed
Ok23 opened this issue Mar 17, 2020 · 4 comments
Closed

Error c4996 in MSVC #945

Ok23 opened this issue Mar 17, 2020 · 4 comments
Assignees
Milestone

Comments

@Ok23
Copy link

Ok23 commented Mar 17, 2020

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.

derceg added a commit to derceg/explorerplusplus that referenced this issue Mar 30, 2020
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.
@ThePhD ThePhD self-assigned this Mar 31, 2020
@ThePhD ThePhD added this to the Helpdesk milestone Mar 31, 2020
@ThePhD
Copy link
Owner

ThePhD commented Mar 31, 2020

We don't use std::iterator anywhere in the cde.

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 std::iterator references but the new code should not have any whatsoever.

@Ok23
Copy link
Author

Ok23 commented Mar 31, 2020

I use 3.2.0 version. I supress this error, so this error is not critical.

ThePhD added a commit that referenced this issue Mar 31, 2020
We will need a new feature to fix #941, which is related to #872.
@ThePhD ThePhD closed this as completed Mar 31, 2020
@ThePhD
Copy link
Owner

ThePhD commented Mar 31, 2020

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.

@Ok23
Copy link
Author

Ok23 commented Mar 31, 2020

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>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants