Git Product home page Git Product logo

Comments (5)

nlohmann avatar nlohmann commented on May 19, 2024

Hi @suy,

thanks for checking by. Unfortunately, MSVC's C++11 support is still very bad. I got some pull requests where the library has been "fixed" to compile, but these changes were a preprocessor nightmare. I would also like to know how more recent versions behave.

I agree that a documentation of supported compilers would be really useful. I shall add a table to the README file and hope to get some feedback about other compilers. By the way, which compiler with MinGW did you try?

from json.

suy avatar suy commented on May 19, 2024

El Tuesday 24 March 2015, Niels escribió:

thanks for checking by. Unfortunately, MSVC's C++11 support is still very
bad. I got some pull requests where the library has been "fixed" to
compile, but these changes were a preprocessor nightmare.

That's what I've always been told, and in this case I can confirm. Many errors
were repeated (e.g. the lack of understanding of no_except), but the compiler
stopped at the 100th error. So yeah, very problematic.

I would also
like to know how more recent versions behave.

My version was 2013. I've read that people are happy about the 2015 pre-
releases, but I don't have access to that myself.

I agree that a documentation of supported compilers would be really useful.
I shall add a table to the README file and hope to get some feedback about
other compilers. By the way, which compiler with MinGW did you try?

Thank you! Any mention of what compilers (and maybe their versions) people
have reported success will be excellent. So far I can report success with
MinGW 4.9.1. I can try with others if you need help in that. Thanks again.

from json.

MPolovyi avatar MPolovyi commented on May 19, 2024

@suy I've just tried with the 2015 (actually, 2014, but nonetheless the latest version), and it gave me much less errors then the 2013. But the "iterator" error you reposted is still there.

if anybody is interested, I include the output of errors... can't really say why they arise, or what are they about - cpp is not my best side :)

1>  stdafx.cpp
1>\json.hpp(144): error C2061: syntax error: identifier 'iterator'
1>  \json.hpp(4523): note: see reference to class template instantiation 'nlohmann::basic_json<ObjectType,ArrayType,StringType,BooleanType,NumberIntegerType,NumberFloatType,Allocator>' being compiled
1>\json.hpp(144): error C2238: unexpected token(s) preceding ';'
1>\json.hpp(150): error C2061: syntax error: identifier 'const_iterator'
1>\json.hpp(150): error C2238: unexpected token(s) preceding ';'
1>\json.hpp(156): error C2061: syntax error: identifier 'reverse_iterator'
1>\json.hpp(156): error C2238: unexpected token(s) preceding ';'
1>\json.hpp(162): error C2061: syntax error: identifier 'const_reverse_iterator'
1>\json.hpp(162): error C2238: unexpected token(s) preceding ';'
1>\json.hpp(409): warning C4346: 'std::is_constructible<StringType,V::key_type>::value': dependent name is not a type
1>  \json.hpp(409): note: prefix with 'typename' to indicate a type
1>\json.hpp(409): error C2146: syntax error: missing '>' before identifier 'and'
1>\json.hpp(409): error C2993: 'std::enable_if<std::is_constructible<StringType,V::key_type>::value,void>': illegal type for non-type template parameter 'public: static bool const std::integral_constant<bool,0>::value'
1>\json.hpp(2049): error C2988: unrecognizable template declaration/definition
1>\json.hpp(2049): error C2059: syntax error: '<end Parse>'
1>\json.hpp(2052): error C2238: unexpected token(s) preceding ';'
1>\json.hpp(177): error C2976: 'std::map': too few template arguments
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\map(69): note: see declaration of 'std::map'
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(810): note: see reference to class template instantiation 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>' being compiled
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(842): note: see reference to class template instantiation 'std::is_nothrow_constructible<_Ty,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator> &&>' being compiled
1>          with
1>          [
1>              _Ty=nlohmann::json
1>          ]
1>  \json.hpp(4549): note: see reference to class template instantiation 'std::is_nothrow_move_constructible<nlohmann::json>' being compiled
1>\json.hpp(179): error C2976: 'std::vector': too few template arguments
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\vector(659): note: see declaration of 'std::vector'
1>\json.hpp(409): error C2993: 'std::enable_if<std::is_constructible<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,V::key_type>::value,void>': illegal type for non-type template parameter 'public: static bool const std::integral_constant<bool,0>::value'
1>\json.hpp(4550): error C2146: syntax error: missing ')' before identifier 'and'
1>\json.hpp(4553): error C2039: 'swap': is not a member of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>'
1>\json.hpp(4565): error C2039: 'dump': is not a member of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>'
1>\json.hpp(4580): error C2039: 'parse': is not a member of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>'
1>\json.hpp(4580): error C3861: 'parse': identifier not found

from json.

suy avatar suy commented on May 19, 2024

Thank you!

from json.

nlohmann avatar nlohmann commented on May 19, 2024

Hi @suy and @MPolovyi, I made some changes for ticket #62 which may affect MSVC support. Maybe you can check whether MSVC 2015 support is now better.

from json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.