rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.11k stars 429 forks source link

Cannot compile json_example in C++17 #351

Open nofairy opened 1 year ago

nofairy commented 1 year ago

I get a warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17,when i compile the json_example project. It seem like a problem of rapidjson,and it has been fixed in https://github.com/Tencent/rapidjson/pull/1137

pozemka commented 1 year ago

Can confirm. Just had an error on MSVS21:

rttr-0.9.6-src\3rd_party\rapidjson-1.1.0\rapidjson/document.h(102,19): warning C4996: 'std::iterator<std::random_access _iterator_tag,const rapidjson::GenericMember<Encoding,Allocator>,ptrdiff_t,const rapidjson::GenericMember<Encoding,Allocator> *,const rap idjson::GenericMember<Encoding,Allocator> &>': warning STL4015: The std::iterator class template (used as a base class to provide typedef s) is deprecated in C++17. (The header is NOT deprecated.) The C++ Standard has never required user-defined iterators to deriv e from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterat or_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant ite rators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.