{"action":"created","issue":{"url":"https://api.github.com/repos/nlohmann/json/issues/110","labels_url":"https://api.github.com/repos/nlohmann/json/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/nlohmann/json/issues/110/comments","events_url":"https://api.github.com/repos/nlohmann/json/issues/110/events","html_url":"https://github.com/nlohmann/json/issues/110","id":100225606,"number":110,"title":"insert json array issue with gcc4.8.2","user":{"login":"tjuliuyou","id":5418088,"avatar_url":"https://avatars.githubusercontent.com/u/5418088?v=3","gravatar_id":"","url":"https://api.github.com/users/tjuliuyou","html_url":"https://github.com/tjuliuyou","followers_url":"https://api.github.com/users/tjuliuyou/followers","following_url":"https://api.github.com/users/tjuliuyou/following{/other_user}","gists_url":"https://api.github.com/users/tjuliuyou/gists{/gist_id}","starred_url":"https://api.github.com/users/tjuliuyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjuliuyou/subscriptions","organizations_url":"https://api.github.com/users/tjuliuyou/orgs","repos_url":"https://api.github.com/users/tjuliuyou/repos","events_url":"https://api.github.com/users/tjuliuyou/events{/privacy}","received_events_url":"https://api.github.com/users/tjuliuyou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nlohmann/json/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars.githubusercontent.com/u/159488?v=3","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-08-11T04:51:42Z","updated_at":"2015-08-11T16:39:15Z","closed_at":null,"body":"The task may like this:\r\n\r\n```json\r\n[\r\n{\r\n \"id\" : \"1111-0000\",\r\n\"content\" : []\r\n},\r\n{\r\n \"id\" : \"1111-2222\",\r\n\"content\" : []\r\n}\r\n]\r\n```\r\nwhen I try to insert json to `_task` \r\n\r\n```cpp\r\n // nlohmann::json _task; \r\n  void add_task(const nlohmann::json& tasks) {\r\n    std::lock_guard<std::mutex> lock(_mtx);\r\n    _task.insert(_task.end(),tasks.cbegin(),tasks.cend());\r\n  }\r\n```\r\nI get this error when using gcc4.8.2 (but worked when using clang3.6)\r\n\r\n```\r\nhome/sven/Workspace/Collector/include/json.hpp: In instantiation of ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType>::iterator nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType>::insert(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType>::const_iterator, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType>::const_iterator, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType>::const_iterator) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberFloatType = double; AllocatorType = std::allocator]’:\r\n/home/sven/Workspace/Collector/Collector/Services/serialize_manager.cpp:46:57:   required from here\r\n/home/sven/Workspace/Collector/include/json.hpp:3897:36: error: no match for ‘operator=’ (operand types are ‘std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::iterator {aka __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >}’ and ‘void’)\r\n         result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator,\r\n                                    ^\r\n/home/sven/Workspace/Collector/include/json.hpp:3897:36: note: candidates are:\r\nIn file included from /usr/include/c++/4.8.2/bits/stl_algobase.h:67:0,\r\n                 from /usr/include/c++/4.8.2/bits/char_traits.h:39,\r\n                 from /usr/include/c++/4.8.2/string:40,\r\n                 from /home/sven/Workspace/Collector/Collector/Services/serialize_manager.h:8,\r\n                 from /home/sven/Workspace/Collector/Collector/Services/serialize_manager.cpp:5:\r\n/usr/include/c++/4.8.2/bits/stl_iterator.h:708:11: note: __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >& __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >::operator=(const __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >&)\r\n     class __normal_iterator\r\n           ^\r\n/usr/include/c++/4.8.2/bits/stl_iterator.h:708:11: note:   no known conversion for argument 1 from ‘void’ to ‘const __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >&’\r\n/usr/include/c++/4.8.2/bits/stl_iterator.h:708:11: note: __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >& __gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >::operator=(__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >&&)\r\n/usr/include/c++/4.8.2/bits/stl_iterator.h:708:11: note:   no known conversion for argument 1 from ‘void’ to ‘__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >&&’\r\ngmake[3]: *** [Collector/CMakeFiles/collector.dir/Services/serialize_manager.cpp.o] Error 1\r\ngmake[2]: *** [Collector/CMakeFiles/collector.dir/all] Error 2\r\ngmake[1]: *** [Collector/CMakeFiles/collector.dir/rule] Error 2\r\ngmake: *** [collector] Error 2\r\n```"},"comment":{"url":"https://api.github.com/repos/nlohmann/json/issues/comments/129961460","html_url":"https://github.com/nlohmann/json/issues/110#issuecomment-129961460","issue_url":"https://api.github.com/repos/nlohmann/json/issues/110","id":129961460,"user":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars.githubusercontent.com/u/159488?v=3","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T16:39:15Z","updated_at":"2015-08-11T16:39:15Z","body":"Thanks for reporting. I'll see if I can reproduce the error."}}