danielaparker / jsoncons

A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
https://danielaparker.github.io/jsoncons
Other
697 stars 160 forks source link

Compile error on EL7 #507

Closed andysCaplin closed 3 months ago

andysCaplin commented 4 months ago

Describe the bug

Build fails with lots of notes and some errors

In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp: In instantiation of ‘void jsoncons::sorted_json_object<KeyT, Json, SequenceContainer>::uninitialized_init(jsoncons::index_key_value<Json>*, std::size_t) [with KeyT = std::basic_string<wchar_t>; Json = jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> >; SequenceContainer = std::vector; std::size_t = long unsigned int]’:
../../libs/jsoncons/include/jsoncons/json_decoder.hpp:165:13:   required from ‘bool jsoncons::json_decoder<Json, TempAllocator>::visit_end_object(const jsoncons::ser_context&, std::error_code&) [with Json = jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> >; TempAllocator = std::allocator<char>]’
../src/test_api_dotnet.cpp:93:1:   required from here
../../libs/jsoncons/include/jsoncons/json_object.hpp:508:17: error: no matching function for call to ‘std::basic_string<wchar_t>::basic_string(jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type&, jsoncons::allocator_holder<std::allocator<char> >::allocator_type)’
                 members_.emplace_back(key_type(first->name,get_allocator()), std::move(first->value));
                 ^
../../libs/jsoncons/include/jsoncons/json_object.hpp:508:17: note: candidates are:
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note: template<class _InputIterator> std::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&)
         basic_string(_InputIterator __beg, _InputIterator __end,
         ^
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note:   template argument deduction/substitution failed:
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp:508:17: note:   deduced conflicting types for parameter ‘_InputIterator’ (‘std::basic_string<wchar_t>’ and ‘std::allocator<char>’)
                 members_.emplace_back(key_type(first->name,get_allocator()), std::move(first->value));
                 ^
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘std::initializer_list<wchar_t>’
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(basic_string&& __str) noexcept
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘std::basic_string<wchar_t>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘const wchar_t*’
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const _CharT* __s, size_type __n,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘const wchar_t*’
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note:   no known conversion for argument 2 from ‘jsoncons::allocator_holder<std::allocator<char> >::allocator_type {aka std::allocator<char>}’ to ‘std::basic_string<wchar_t>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(const basic_string& __str);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(const _Alloc& __a);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string()
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note:   candidate expects 0 arguments, 2 provided
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp:514:25: error: no matching function for call to ‘std::basic_string<wchar_t>::basic_string(jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type&, jsoncons::allocator_holder<std::allocator<char> >::allocator_type)’
                         members_.emplace_back(key_type(it->name,get_allocator()), std::move(it->value));
                         ^
../../libs/jsoncons/include/jsoncons/json_object.hpp:514:25: note: candidates are:
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note: template<class _InputIterator> std::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&)
         basic_string(_InputIterator __beg, _InputIterator __end,
         ^
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note:   template argument deduction/substitution failed:
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp:514:25: note:   deduced conflicting types for parameter ‘_InputIterator’ (‘std::basic_string<wchar_t>’ and ‘std::allocator<char>’)
                         members_.emplace_back(key_type(it->name,get_allocator()), std::move(it->value));
                         ^
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘std::initializer_list<wchar_t>’
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(basic_string&& __str) noexcept
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘std::basic_string<wchar_t>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘const wchar_t*’
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const _CharT* __s, size_type __n,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<wchar_t>}’ to ‘const wchar_t*’
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note:   no known conversion for argument 2 from ‘jsoncons::allocator_holder<std::allocator<char> >::allocator_type {aka std::allocator<char>}’ to ‘std::basic_string<wchar_t>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(const basic_string& __str);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string(const _Alloc& __a);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Alloc = std::allocator<wchar_t>]
       basic_string()
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note:   candidate expects 0 arguments, 2 provided
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp: In instantiation of ‘void jsoncons::sorted_json_object<KeyT, Json, SequenceContainer>::uninitialized_init(jsoncons::index_key_value<Json>*, std::size_t) [with KeyT = std::basic_string<char>; Json = jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> >; SequenceContainer = std::vector; std::size_t = long unsigned int]’:
../../libs/jsoncons/include/jsoncons/json_decoder.hpp:165:13:   required from ‘bool jsoncons::json_decoder<Json, TempAllocator>::visit_end_object(const jsoncons::ser_context&, std::error_code&) [with Json = jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> >; TempAllocator = std::allocator<char>]’
../src/test_api_dotnet.cpp:93:1:   required from here
../../libs/jsoncons/include/jsoncons/json_object.hpp:508:17: error: no matching function for call to ‘std::basic_string<char>::basic_string(jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type&, jsoncons::allocator_holder<std::allocator<char> >::allocator_type)’
                 members_.emplace_back(key_type(first->name,get_allocator()), std::move(first->value));
                 ^
../../libs/jsoncons/include/jsoncons/json_object.hpp:508:17: note: candidates are:
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note: template<class _InputIterator> std::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&)
         basic_string(_InputIterator __beg, _InputIterator __end,
         ^
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note:   template argument deduction/substitution failed:
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp:508:17: note:   deduced conflicting types for parameter ‘_InputIterator’ (‘std::basic_string<char>’ and ‘std::allocator<char>’)
                 members_.emplace_back(key_type(first->name,get_allocator()), std::move(first->value));
                 ^
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘std::initializer_list<char>’
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(basic_string&& __str) noexcept
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘std::basic_string<char>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const _CharT* __s, size_type __n,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note:   no known conversion for argument 2 from ‘jsoncons::allocator_holder<std::allocator<char> >::allocator_type {aka std::allocator<char>}’ to ‘std::basic_string<char>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const basic_string& __str);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const _Alloc& __a);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string()
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note:   candidate expects 0 arguments, 2 provided
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp:514:25: error: no matching function for call to ‘std::basic_string<char>::basic_string(jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type&, jsoncons::allocator_holder<std::allocator<char> >::allocator_type)’
                         members_.emplace_back(key_type(it->name,get_allocator()), std::move(it->value));
                         ^
../../libs/jsoncons/include/jsoncons/json_object.hpp:514:25: note: candidates are:
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note: template<class _InputIterator> std::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&)
         basic_string(_InputIterator __beg, _InputIterator __end,
         ^
/usr/include/c++/4.8.2/bits/basic_string.h:532:9: note:   template argument deduction/substitution failed:
In file included from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:30:0,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
../../libs/jsoncons/include/jsoncons/json_object.hpp:514:25: note:   deduced conflicting types for parameter ‘_InputIterator’ (‘std::basic_string<char>’ and ‘std::allocator<char>’)
                         members_.emplace_back(key_type(it->name,get_allocator()), std::move(it->value));
                         ^
In file included from /usr/include/c++/4.8.2/string:52:0,
                 from ../../libs/jsoncons/include/jsoncons/basic_json.hpp:11,
                 from ../../libs/jsoncons/include/jsoncons/json.hpp:10,
                 from ../src/api_dotnet.cpp:7,
                 from ../src/test_api_dotnet.cpp:9:
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:522:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘std::initializer_list<char>’
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(basic_string&& __str) noexcept
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:507:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:497:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘std::basic_string<char>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:490:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const _CharT* __s, size_type __n,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:483:7: note:   no known conversion for argument 1 from ‘jsoncons::index_key_value<jsoncons::basic_json<char, jsoncons::sorted_policy, std::allocator<char> > >::key_type {aka std::basic_string<char>}’ to ‘const char*’
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:471:7: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
       basic_string(const basic_string& __str, size_type __pos,
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:462:7: note:   no known conversion for argument 2 from ‘jsoncons::allocator_holder<std::allocator<char> >::allocator_type {aka std::allocator<char>}’ to ‘std::basic_string<char>::size_type {aka long unsigned int}’
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const basic_string& __str);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:455:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string(const _Alloc& __a);
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:448:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       basic_string()
       ^
/usr/include/c++/4.8.2/bits/basic_string.h:437:7: note:   candidate expects 0 arguments, 2 provided

Enumerate the steps to reproduce the bug Compiled a cpp file that included the jsoncons files

What compiler, architecture, and operating system?

What jsoncons library version?

danielaparker commented 4 months ago

I'll have a look, but we may have to drop support for g++ 4.8, it was never fully C++ 11 compliant, required many work arounds, and we no longer have test coverage for it.

andysCaplin commented 3 months ago

We got around this by enabling devtoolset-9, so I'm closing it.