Comments (5)
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.
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.
@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.
Thank you!
from json.
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)
- Initializing `json` by direct initialization and copy initialization invokes different constructors HOT 2
- why a single-object json file appears in an array HOT 2
- In highly nested functions, passing json into a function leads to a segmentation fault/bus error HOT 15
- Exception SIGSEGV - Segmentation violation signal on file parsing (v3.11.2, linux, doctest) HOT 5
- use of overloaded operator '<=>' is ambiguous HOT 9
- README.md overuses `template` keyword before `get` function HOT 2
- Parser and constructor resolve integer types differently HOT 3
- Exception thrown when dumping utf-8 characters when using std::string HOT 2
- 3.11.3: test suite fails in 4 units HOT 8
- Deprecation warning on save action in check-amalgamation CI step HOT 1
- Build failure on macOS Sonoma 14.1.1 HOT 4
- very accidental: SIGABRT when parsing json string with allow_exceptions=false HOT 7
- `to_json` is erroneously converting enums with underlying unsigned types to signed numbers
- Exception when trying to insert my json object inside json file HOT 4
- Issue with including <version> HOT 2
- stack overflow while fuzzing parse-cbor-fuzzer HOT 3
- NLOHMANN_JSON_FROM* macros not comptaible with non-default-constructible types HOT 6
- Parsing simple zeroes throws type exception HOT 1
- Newer serialization macros not listed in README
- Cannot use std::format on nholman::json objects HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json.