taocpp / json Goto Github PK
View Code? Open in Web Editor NEWC++ header-only JSON library
License: MIT License
C++ header-only JSON library
License: MIT License
Since the new variant commit:
error C3861: '__builtin_expect': identifier not found
json\basic_value.hpp(508): error C3861: '__builtin_expect': identifier not found
__builtin_expect is not available with MSVC.
I'm must be missing something very obvious, but can't figure out how to correctly initialise json::value from std::map<std::string, std::string> and then compare to value parsed from string.
Value from map seems working if I add my_traits from std::map<string,string> similarly to #12 but then I need to compare the result to existing value parsed from string:
auto expected = tao::json::from_string(expectedData); tao::json::basic_value< my_traits > w( map ); EXPECT(expected == w)
This gives me an error: Invalid operands to binary expression ('const tao::json::basic_value::array_t' (aka 'const vector<tao::json::basic_value >') and 'const tao::json::basic_value<my_traits>::array_t' (aka 'const vector<tao::json::basic_value<my_traits> >'))
Is there any way to calculate serialized to string JSON Value size without doing actual serialization?
If not, what is the right way to do it?
In file included from Calculator.cpp:2:
In file included from ./tao/json.hpp:8:
In file included from ./tao/json/value.hpp:7:
In file included from ./tao/json/basic_value.hpp:15:
In file included from ./tao/json/events/virtual_base.hpp:12:
./tao/json/events/../byte_view.hpp:130:37: error: cannot use 'throw' with exceptions disabled
return ( pos >= size() ) ? throw std::out_of_range( "index out of range in tao::basic_byte_view::at" ) : data_[ pos ]; // NOLINT
^
./tao/json/events/../byte_view.hpp:168:13: error: cannot use 'throw' with exceptions disabled
throw std::out_of_range( "index out of range in tao::basic_byte_view::copy" ); // NOLINT
^
./tao/json/events/../byte_view.hpp:177:36: error: cannot use 'throw' with exceptions disabled
return ( pos > size() ) ? throw std::out_of_range( "index out of range in tao::basic_byte_view::substr" ) : basic_byte_view( data() + pos, std::min( n, size() - p...
^
In file included from Calculator.cpp:2:
In file included from ./tao/json.hpp:8:
In file included from ./tao/json/value.hpp:7:
In file included from ./tao/json/basic_value.hpp:15:
In file included from ./tao/json/events/virtual_base.hpp:14:
./tao/json/events/../external/string_view.hpp:171:37: error: cannot use 'throw' with exceptions disabled
return ( pos >= size() ) ? throw std::out_of_range( "index out of range in tao::basic_string_view::at" ) : data_[ pos ];
^
./tao/json/events/../external/string_view.hpp:211:13: error: cannot use 'throw' with exceptions disabled
throw std::out_of_range( "index out of range in tao::basic_string_view::copy" );
^
./tao/json/events/../external/string_view.hpp:220:36: error: cannot use 'throw' with exceptions disabled
return ( pos > size() ) ? throw std::out_of_range( "index out of range in tao::basic_string_view::substr" ) : basic_string_view( data() + pos, std::min( n, size(...
^
In file included from Calculator.cpp:2:
In file included from ./tao/json.hpp:8:
In file included from ./tao/json/value.hpp:7:
In file included from ./tao/json/basic_value.hpp:18:
In file included from ./tao/json/external/optional.hpp:26:
./tao/json/external/akrzemi1/optional.hpp:527:47: error: cannot use 'throw' with exceptions disabled
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
^
./tao/json/external/akrzemi1/optional.hpp:531:47: error: cannot use 'throw' with exceptions disabled
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
^
./tao/json/external/akrzemi1/optional.hpp:535:25: error: cannot use 'throw' with exceptions disabled
if (!initialized()) throw bad_optional_access("bad optional access");
^
./tao/json/external/akrzemi1/optional.hpp:691:26: error: cannot use 'throw' with exceptions disabled
return ref ? *ref : (throw bad_optional_access("bad optional access"), *ref);
^
In file included from Calculator.cpp:2:
In file included from ./tao/json.hpp:8:
In file included from ./tao/json/value.hpp:7:
In file included from ./tao/json/basic_value.hpp:29:
./tao/json/pointer.hpp:109:16: error: cannot use 'throw' with exceptions disabled
throw std::invalid_argument( "unable to resolve JSON Pointer, invalid token for array access '" + m_key + '\'' ); // NOLINT
^
./tao/json/pointer.hpp:137:19: error: cannot use 'throw' with exceptions disabled
throw std::invalid_argument( "invalid JSON Pointer value, must be empty or begin with '/'" ); // NOLINT
^
./tao/json/pointer.hpp:154:25: error: cannot use 'throw' with exceptions disabled
throw std::invalid_argument( "invalid JSON Pointer escape sequence, '~' must be followed by '0' or '1'" ); // NOLINT
^
./tao/json/pointer.hpp:330:22: error: cannot use 'throw' with exceptions disabled
throw invalid_type( begin, std::next( it ) ); // NOLINT
^
In file included from Calculator.cpp:2:
In file included from ./tao/json.hpp:8:
In file included from ./tao/json/value.hpp:7:
./tao/json/basic_value.hpp:41:13: error: cannot use 'throw' with exceptions disabled
throw;
^
./tao/json/basic_value.hpp:80:13: error: cannot use 'try' with exceptions disabled
try {
^
./tao/json/basic_value.hpp:103:16: error: cannot use 'throw' with exceptions disabled
throw;
^
./tao/json/basic_value.hpp:95:13: error: cannot use 'try' with exceptions disabled
try {
^
./tao/json/basic_value.hpp:117:16: error: cannot use 'throw' with exceptions disabled
throw;
^
I wonder why tao::json::type
has three non-type values? I.e. there are UNINITIALIZED
, DISCARDED
and DESTROYED
. I fail to find the reason in the code. It looks redundant and brittle: the more special cases there are the more possibility for errors.
Checking for DESTROYED
state in debug builds opens up another issue: since this code is header-only there may be ODR violation if some TUs with different NDEBUG
setting are linked together.
So I would suggest to merge these three into one, say, UNDEFINED
state, with the following semantics:
UNDEFINED
UNDEFINED
UNDEFINED
is legal and results in lhs to also become UNDEFINED
UNDEFINED
values are equalI could prepare a PR if you are interested to give it a try.
With MSVC:
include\tao\json\external\ryu.hpp(1117): error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
I'm not sure if you want to add a workaround for MSVC or if the lib requires that _CRT_SECURE_NO_WARNINGS is defined?
My proposed workaround :
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4996 )
#endif
std::strcpy( result, sign ? "-0.0" : "0.0" );
#ifdef _MSC_VER
#pragma warning( pop )
#endif
compile error with the latest version using MSVC:
taocpp-json\json\include\tao\json\pointer.hpp(203): error C2065: 'PRETTY_FUNCTION': undeclared identifier
It would be nice to be able to use visitors on json values like you would with std::visit.
see: https://en.cppreference.com/w/cpp/utility/variant/visit
What?
Include Conan.io support to this project
Why?
Conan is an opportunity to distribute this project as a package.
How?
With MSVC 2019 16.4 Preview 4
taocpp-json\json\include\tao\json\basic_value.hpp(68,1): error C2607: static assertion failed
static_assert( std::is_nothrow_move_assignable_v< variant_t > );
I believe it started since this commit:
cc69b1d
I'm trying to update some code from b755c77 to HEAD and I see that the 'value' class has been renamed to 'data', but it seems you cannot simply assign integer values or string literals to this object now.
What's the recommended usage here?
I'll keep it as short as possible:
Works:
obj.at_key("firstPickpointKey").template as<rigging::PickpointKey>(),
Does not work:
obj.at_key("secondPickpointKey").template as<std::pair<rigging::PickpointKey, float>>()
with error
../../../../../projectname/include/taocpp/json/include/tao/json/binding/internal/../../basic_value.hpp:1273:12: error: no matching constructor for initialization of 'std::pair<CVO::array::rigging::PickpointKey, float>'
T v;
^
../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../traits.hpp:887:28: note: in instantiation of function template specialization 'tao::json::basic_value<traits>::as<std::pair<CVO::array::rigging::PickpointKey, float> >' requested here
return v.template as< T >();
^
../../../../../projectname/include/taocpp/json/include/tao/json/binding/internal/../../basic_value.hpp:1267:30: note: in instantiation of function template specialization 'tao::json::traits<std::optional<std::pair<CVO::array::rigging::PickpointKey, float> >, void>::as<traits>' requested here
return Traits< T >::as( *this );
I've patched the pair traits temporarily (manually instead of using the array binding traits)
We should test with MSVC 2019. PRs welcome.
when windows.h is included before taocpp, the following error occurs:
\include\tao\json\binding\member_kind.hpp(15): error C2059: syntax error: ','
The problem is caused by the OPTIONAL define:
enum class member_kind : bool
{
OPTIONAL,
REQUIRED
};
which is defined in:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\shared\minwindef.h
#ifndef OPTIONAL
#define OPTIONAL
#endif
Similar issues with TRUE and FALSE:
include\tao\json\msgpack\internal\format.hpp
FALSE = 0xc2,
TRUE = 0xc3,
The workaround is to undefine them before including tao:
#undef OPTIONAL
#undef TRUE
#undef FALSE
but this is not very practical (TRUE/FALSE are used everywhere in a typical Windows app).
I believe this project is awesome but it also needs an awesome documentation. Or at least better documentations... actually at least some examples.
Yes, there are tests but it is hard to read them.
Hi!
If I have an existing vector, say
std::vector<int> example_vector{1, 2, 3, 4};
is it possible to create a json value from it other than making iterating emplace_back
with for?
tao::json::value::array foo(example_vector); // error
Thanks for the project taocpp
. IMO, json
can be used with any compiler supports C++17
. But I have a question. Can MSVC use this project? I have ran tests and examples with VC2017
and VC2019
, they all fail building with some template errors:
[build] E:\SourceViewProjects\taocpp\json\include\tao\json/parts_parser.hpp(131): error C2872: 'internal': ambiguous symbol
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\events/tee.hpp(20): note: could be 'tao::json::internal'
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\mmap_input.hpp(28): note: or 'tao::json::pegtl::internal'
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\normal.hpp(60): note: see reference to class template instantiation 'tao::json::internal::double_action<tao::json::internal::rules::zero<true>>' being compiled
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\internal\grammar.hpp(166): note: see reference to function template instantiation 'bool tao::json::internal::rules::sor_value::match_zero<true,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json/parts_parser.hpp(93): note: see reference to function template instantiation 'bool tao::json::internal::rules::sor_value::match_number<true,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json/parts_parser.hpp(116): note: see reference to function template instantiation 'bool tao::json::internal::rules::double_rule::match_impl<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(37): note: see reference to function template instantiation 'bool tao::json::internal::rules::double_rule::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(60): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,tao::json::pegtl::internal::dusel_mode::nothing>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(63): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,tao::json::pegtl::internal::dusel_mode::nothing>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\match.hpp(36): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,tao::json::pegtl::internal::dusel_mode::control>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\match.hpp(68): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,tao::json::pegtl::internal::dusel_mode::control>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\normal.hpp(74): note: see reference to function template instantiation 'bool tao::json::pegtl::match<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal\must.hpp(59): note: see reference to function template instantiation 'bool tao::json::pegtl::normal<Rule>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal\must.hpp(60): note: see reference to function template instantiation 'bool tao::json::pegtl::normal<Rule>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::dontcare,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::internal::rules::double_rule,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(37): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(38): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\match.hpp(36): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,tao::json::pegtl::internal::dusel_mode::nothing>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\match.hpp(68): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,tao::json::pegtl::internal::dusel_mode::nothing>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\normal.hpp(74): note: see reference to function template instantiation 'bool tao::json::pegtl::match<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal\must.hpp(36): note: see reference to function template instantiation 'bool tao::json::pegtl::normal<tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal\must.hpp(37): note: see reference to function template instantiation 'bool tao::json::pegtl::normal<tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule>>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(37): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(38): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(60): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,tao::json::pegtl::internal::dusel_mode::nothing>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\internal/duseltronik.hpp(63): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,tao::json::pegtl::internal::dusel_mode::nothing>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\match.hpp(36): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,tao::json::pegtl::internal::dusel_mode::control>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\match.hpp(68): note: see reference to function template instantiation 'bool tao::json::pegtl::internal::duseltronik<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,tao::json::pegtl::internal::dusel_mode::control>::match<Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl\normal.hpp(74): note: see reference to function template instantiation 'bool tao::json::pegtl::match<Rule,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl/parse.hpp(28): note: see reference to function template instantiation 'bool tao::json::pegtl::normal<Rule>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\external\pegtl/parse.hpp(29): note: see reference to function template instantiation 'bool tao::json::pegtl::normal<Rule>::match<tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Action,Control,Input,tao::json::internal::double_state_and_consumer&>(Input &,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Rule=tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,
[build] Action=tao::json::internal::double_action,
[build] Control=tao::json::pegtl::normal,
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json/parts_parser.hpp(201): note: see reference to function template instantiation 'bool tao::json::pegtl::parse<tao::json::pegtl::must<tao::json::internal::rules::double_rule,tao::json::internal::rules::wss>,tao::json::internal::double_action,tao::json::pegtl::normal,tao::json::pegtl::apply_mode::action,tao::json::pegtl::rewind_mode::required,Input&,tao::json::internal::double_state_and_consumer&>(tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>&,tao::json::internal::double_state_and_consumer &)' being compiled
[build] with
[build] [
[build] Input=tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>
[build] ]
[build] E:\SourceViewProjects\taocpp\json\include\tao\json/parts_parser.hpp(199): note: while compiling class template member function 'double tao::json::basic_parts_parser<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>>::number_double(void)'
[build] E:\SourceViewProjects\taocpp\json\include\tao\json\internal/number_traits.hpp(201): note: see reference to function template instantiation 'double tao::json::basic_parts_parser<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>>::number_double(void)' being compiled
[build] E:\SourceViewProjects\taocpp\json\include\tao\json/consume_string.hpp(20): note: see reference to class template instantiation 'tao::json::basic_parts_parser<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy,tao::json::pegtl::ascii::eol::lf_crlf,const char *>>' being compiled
[build] ..\src\test\json\binding_object.cpp(78): note: see reference to function template instantiation 'T tao::json::consume_string<tao::json::type_1,tao::json::traits,const char(&)[68]>(F)' being compiled
[build] with
[build] [
[build] T=tao::json::type_1,
[build] F=const char (&)[68]
[build] ]
I confirm that gcc
under Linux works quiet well (I can find in some issues, someone said they aren't mainly working in Windows). I also try with MinGW
, gcc 8.3
will stall when linking the last file validate_event_order.cpp
. I wait for more than 3 hours, but ld.exe
does not finish its linking process.
Thanks!
https://github.com/taocpp/json/blob/master/include/tao/json/traits.hpp#L33
In traits, line 33, there is a static assert to check if type size equals 0. Why?
Beta 9 release fails to compile under clang 6.0.
clang++-6.0 --version
clang version 6.0.0-svn321433-1~exp1 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
[10/76] Building CXX object src/test/json/CMakeFiles/ostream.dir/ostream.cpp.o
FAILED: /usr/bin/clang++-6.0 -I/home/csnelson/meps/projects/mf/toolchain/tao-json-1.0.0-beta.9/include -g -pedantic -Wall -Wextra -Wshadow -Werror -std=c++11 -MMD -MT src/test/json/CMakeFiles/ostream.dir/ostream.cpp.o -MF src/test/json/CMakeFiles/ostream.dir/ostream.cpp.o.d -o src/test/json/CMakeFiles/ostream.dir/ostream.cpp.o -c /home/csnelson/meps/projects/mf/toolchain/tao-json-1.0.0-beta.9/src/test/json/ostream.cpp
In file included from /home/csnelson/meps/projects/mf/toolchain/tao-json-1.0.0-beta.9/src/test/json/ostream.cpp:6:
/home/csnelson/meps/projects/mf/toolchain/tao-json-1.0.0-beta.9/include/tao/json/stream.hpp:25:51: error: result of comparison 'std::uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare]
if( static_cast< std::uint64_t >( w ) > static_cast< std::uint64_t >( std::numeric_limits< std::size_t >::max() ) ) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Hi,
We do crossbuilds for OSX and I stumbled upon a few issues.
I'll provide details later, but they are all related to the usage of std::vector<bool>
and type traits not working.
This is most probably an OSX SDK issue though, but I think we might find a generic solution, because this could happen with different implementations too.
Hi,
When compiling with MSVC, I get several errors because of nodiscard (tao\json\external\pegtl\internal/duseltronik.hpp(140): warning C4834: Der Rรผckgabewert einer Funktion mit dem "nodiscard"-Attribut wird verworfen.
)
Line are
duseltronik.hpp(140)
duseltronik.hpp(89)
Full (example) trace:
https://pastebin.com/dvhspErc
I have a project that uses PEGTL and I'll need to read JSON files in this project. So I thought about taocpp/json.
I'm thinking what's the best way to avoid having two copies of PEGTL.
I understand that separate copies may be desirable in some situations, but for me a single version of PEGTL should be sufficient. Currently I keep it in gemmi/third_party/tao/pegtl*
(gemmi is the name of my project) and I include it with
#include <tao/pegtl.hpp>
It seems to me that the easiest workaround to have a single version of PEGTL when I add tao/json to gemmi/third_party
would be to replace #includes and namespaces in my project to:
#include <tao/json/external/pegtl.hpp>
Although it's not very elegant. Any thoughts?
I believe uniformal initialization should be supported:
tao::json::value value;
auto other{ std::move(value) };
But this is the compiler error:
\tao\json\internal\pair.hpp(27): error C2039: 'default_key': is not a member of 'tao::json::traits<tao::json::basic_valuetao::json::traits,tao::json::internal::empty_base,void>'
double.hpp does not support Windows ARM64:
include\tao\json\external\double.hpp
#error Target architecture was not detected as supported by Double-Conversion.
It might be enough to add:
defined(_M_ARM64)
to the if clause.
I would like to be able to identify a floating point number and instead of converting it to a double, I would like to convert it to a custom type, eg.
namespace mp = boost::multiprecision;
mp::number<mp::cpp_dec_float_50>
At first I attempted to use type traits but these solutions all convert the string to a double first. The following line is what I imagine would need to be abstracted.
I may try to hack something together, but I wanted to know if you had any plans to support this kind of feature.
Thanks!
std::string tt = "{\"test_s\": \"straaaa\", \"test_i\": 5, \"test_d\": 123.456}";
tao::json::custom_value v = tao::json::custom_from_string(tt.c_str());
// after parse test_i is unsigned, use get_signed can't get the value
std::cout << v["test_i"].get_unsigned() << std::endl;
// if i use get_unsigned and stored in signed int, it also work
// int a = v.["test_i"].get_unsigned();
// std::cout << a << std::endl;
// if i reset with int(yes it is signed int), v["test_i"] became singned, get_signed will work
v["test_i"] = 111;
std::cout << v["test_i"].get_signed() << std::endl;
if parse from string can't distinguish it is signed or unsigned, should get_unsigned and get_signed can both work?
if that the code look more unified
int a = v.["test_i"].get_signed();
std::cout << a << std::endl;
v["test_i"] = 111;
std::cout << v["test_i"].get_signed() << std::endl;
// unsigned int a = v.["test_i"].get_unsigned();
// std::cout << a << std::endl;
// v["test_i"] = 111u;
// std::cout << v["test_i"].get_unsigned() << std::endl;
After to have Conan 1.5.0 we are able to build a header-only package on Windows by CMake helper, without settings.
Hi! I see there is a tao::json::patch()
function in contrib. Is there a way to "diff" two json objects to create a patch suitable for this function?
I see that nlohmann's implementation has a diff implementation if that helps.
Thanks!
Hi,
I have a class with pure virtual function:
#include <tao/json/value.hpp> class ab{ [[nodiscard]] virtual std::shared_ptr<action_msg> get_message(const tao::json::value & v) const = 0; };
I would like a way to forward declare tao::json::value
and get rid of the include.
Is there such a way?
Thanks
On line 554 of span.hpp
:
using std::as_writeable_bytes;
should be written
using std::as_writable_bytes;
.
I assumed (wrongly) that get<type::SOMETHING>()
was just an alternative way of calling get_something()
. Apparently just for basic types. For arrays (and possibly for objects and strings), the templated version is returning by copy, while get_array()
returns by reference. Shouldn't both return by reference?
I updated to the latest commit, and I have encountered a compilation issue.
I am running gcc version (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609.
I use a CMake file to build my program, and I have the following set:
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 11)
I primarily use the JAXN interface with events and to/from_string() functions.
After removing the following code in element.hpp (lines 97-129), I am once again able to compile.
template< typename C, typename T, T ( *P )( const C& ), typename U, U( *Q )( C& ) >
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
{
static auto read( const C& v ) -> decltype( P( v ) )
{
return P( v );
}
template< typename W >
static void write( C& v, W&& w )
{
Q( v ) = std::forward< W >( w );
}
template< template< typename... > class Traits, typename Base >
static void as( const basic_value< Traits, Base >& v, C& x )
{
v.as( Q( x ) );
}
template< template< typename... > class Traits = traits, typename Producer >
static void consume( Producer& parser, C& v )
{
json::consume< Traits >( parser, Q( v ) );
}
template< template< typename... > class Traits = traits, typename Consumer >
static void produce( Consumer& consumer, const C& v )
{
events::produce< Traits >( consumer, P( v ) );
}
};
Here is the full set of compile errors:
/home/user/src/json/include/tao/json/binding/element.hpp:98:81: error: expected identifier before โ*โ token
template< typename C, typename T, T ( *P )( const C& ), typename U, U( *Q )( C& ) >
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:61: error: wrong number of template arguments (3, should be at least 4)
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:96:17: note: provided for โtemplate<class T, T <anonymous>, class U, U <anonymous>, class> struct tao::json::binding::element2โ
struct element2;
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:63: error: expected unqualified-id before โ)โ token
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:98:81: error: expected identifier before โ*โ token
template< typename C, typename T, T ( *P )( const C& ), typename U, U( *Q )( C& ) >
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:61: error: wrong number of template arguments (3, should be at least 4)
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:96:17: note: provided for โtemplate<class T, T <anonymous>, class U, U <anonymous>, class> struct tao::json::binding::element2โ
struct element2;
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:63: error: expected unqualified-id before โ)โ token
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:98:81: error: expected identifier before โ*โ token
template< typename C, typename T, T ( *P )( const C& ), typename U, U( *Q )( C& ) >
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:61: error: wrong number of template arguments (3, should be at least 4)
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:96:17: note: provided for โtemplate<class T, T <anonymous>, class U, U <anonymous>, class> struct tao::json::binding::element2โ
struct element2;
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:63: error: expected unqualified-id before โ)โ token
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:98:81: error: expected identifier before โ*โ token
template< typename C, typename T, T ( *P )( const C& ), typename U, U( *Q )( C& ) >
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:61: error: wrong number of template arguments (3, should be at least 4)
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
/home/user/src/json/include/tao/json/binding/element.hpp:96:17: note: provided for โtemplate<class T, T <anonymous>, class U, U <anonymous>, class> struct tao::json::binding::element2โ
struct element2;
^
/home/user/src/json/include/tao/json/binding/element.hpp:99:63: error: expected unqualified-id before โ)โ token
struct element2< T ( * )( const C& ), P, U ( * )( C& ), Q >
^
I just switched to gcc-7.3 from gcc-5.4 and bumped up my taocpp::json version from beta.8 to beta.11. The following assignment no longer works. Any thoughts?
boost::optional<tao::json::value> bov;
bov = boost::none;
The error is
/taojson/include/tao/json/basic_value.hpp:78:81: error: incomplete type โtao::json::traits<boost::none_t>โ used in nested name specifier
noexcept( noexcept( Traits< typename std::decay< T >::type >::assign( std::declval< basic_value& >(), std::forward< T >( v ) ) ) )
simply I use from_string("{"z":1,"a":2}");
I get an object sorted by keys, "a" is in front of "z" when travels. I want the origin format ,how can I do that
For consistency. Trying to find a value via a pointer currently requires a try-block.
It would be wonderful to have an amalgamated distribution of the code for quick deployment.
Hi,
I found that get_signed() throws for non-negative numbers. For e.g. the line
TEST_ASSERT( custom_from_string( "1" ).get_signed() == 1 );
throws message as follows
json: unit test [ custom_from_string( "1" ).get_signed() == 1 ] threw an exception [ invalid json type 'unsigned' ] in line [ 95 ] file [ ../src/test/json/parse.cpp ]
In my case, I've to use "get_signed()" but the number need not necessarily be a negative number. I think get_signed() should also work for non-negative numbers.
Thanks,
Naren.
In several basic_value<>
constructors the destructor is called on not-yet constructed object:
basic_value( ... )
{
try { ... }
catch( ... ) {
this->~basic_value(); // <== here
throw;
}
}
This seems like UB, though I'm not prepared to cite the relevant part of the Standard now.
Anyway, this leads to destructors of base subobjects to be called twice: first time when you explicitly call ~basic_value()
and second time after rethrow, when already constructed base subobject gets destructed.
Hello, I am upgrading from an old version of the library and am disappointed to see that the empty() function has been removed. I found it helpful and clear to determine whether a document was a container and had anything inside it (without knowing its exact type). Would you consider re-adding it? Otherwise I'll need to add my own extension to do the same.
Strictly speaking, JSON has only one numerical type, probably best represented in C++ by double
, but numbers inputted without decimal point are regarded as integers by the parser, and as unsigned
if an integer is positive. I think it a nice feature, because those are the types supported by C, but it may complicate the handling of numbers.
The creator of the JSON data has no obvious reason to write 1.0 instead of 1, even if she knows the value is semantically a real number, after all, JSON standard makes no distinction between numbers, and every integer is also a real. So, to write a portable application parsing such data, the programmer must account that what he expects as a real might come as double
, signed
or unsigned
, and what he expects as integer might come either as signed
or unsigned
. So, I suggest that:
REAL
and INTEGER
, and their respective get_<type>
and is_<type>
;get<type::REAL>()
and get_real()
returns the value cast as double
if it is either DOUBLE
, SIGNED
or UNSIGNED
, and only throw exception for non-numbers;get<type::INTEGER>
and get_integer()
returns the value cast as int64_t
if it is either SIGNED
or UNSIGNED
. I am not sure if it is worth to consider DOUBLE
s that are exactly a whole number, or too close to one.See https://ci.appveyor.com/project/taocpp/json
We get an ICE at .../MSVC/.../include/xtree:411, the problem only occurs with Win64 and Debug build, GCC and Clang accept the code without problems. PRs welcome.
MSVC15 complains about this line:
inline std::uint64_t umul128( const std::uint64_t a, const std::uint64_t b, std::uint64_t& const productHi )
Hi,
I'm getting a lot of errors when cross compiling for windows and honestly, I don't have the slightest clue why.
FAILED: CMakeFiles/addon.dir/src/PlanLibrary.cc.obj
/usr/bin/clang-cl-7 /nologo -TP -DNOMINMAX -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_WARN -D_USE_MATH_DEFINES -Daddon_EXPORTS -I/root/.cmake-ts/electron/win32/x64/v4.0.1/include/node -I../../../../../node_modules/nan -I../../../../../projectname/include -I../../../../../ff/src -I../../../../../projectname/include/taocpp/json/include -D_CRT_SECURE_NO_WARNINGS -EHsc -Xclang -std=gnu++17 --target=x86_64-windows-msvc -fms-compatibility-version=19.11 -Wno-unused-command-line-argument -imsvc /msvc/include -imsvc /winsdk/Include/10.0.17763.0/ucrt -imsvc /winsdk/Include/10.0.17763.0/shared -imsvc /winsdk/Include/10.0.17763.0/um -imsvc /winsdk/Include/10.0.17763.0/winrt -Xclang -ivfsoverlay -Xclang /builds/companyname/parent-module/staging/win32/x64/electron/64/winsdk_vfs_overlay.yaml -s /MP /arch:AVX2 /MD /O2 /Ob2 /DNDEBUG /O2 /fp:fast -fcolor-diagnostics -std:c++17 /showIncludes /FoCMakeFiles/addon.dir/src/PlanLibrary.cc.obj /FdCMakeFiles/addon.dir/ -c ../../../../../src/PlanLibrary.cc
clang: warning: unknown argument ignored in clang-cl: '-s' [-Wunknown-argument]
In file included from ../../../../../src/PlanLibrary.cc:1:
In file included from ../../../../../src/PlanLibrary.h:5:
In file included from ../../../../../projectname/include/library/PlanLibrary.hpp:11:
In file included from ../../../../../projectname/include/library/OnDemandLibraryBase.hpp:4:
In file included from ../../../../../projectname/include/library/ILibrary.hpp:9:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json.hpp:8:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/value.hpp:7:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/basic_value.hpp:21:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/internal/format.hpp:17:
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/demangle.hpp(49,36): error: invalid operands to binary expression ('std::basic_string_view<char, std::char_traits<char> >::const_iterator' (aka '_String_view_iterator<std::char_traits<char> >') and 'const char *const')
return { begin + 2, sv.end() - begin - 3 };
~~~~~~~~ ^ ~~~~~
/msvc/include/xstring(656,45): note: candidate function not viable: no known conversion from 'const char *const' to 'const std::_String_view_iterator::difference_type' (aka 'const long long') for 1st argument; dereference the argument with *
_NODISCARD constexpr _String_view_iterator operator-(const difference_type _Off) const noexcept
^
/msvc/include/xstring(663,39): note: candidate function not viable: no known conversion from 'const char *const' to 'const std::_String_view_iterator<std::char_traits<char> >' for 1st argument
_NODISCARD constexpr difference_type operator-(const _String_view_iterator& _Right) const noexcept
^
/msvc/include/xutility(1448,31): note: candidate template ignored: could not match 'reverse_iterator' against '_String_view_iterator'
_NODISCARD _CONSTEXPR17 auto operator-(const reverse_iterator<_BidIt1>& _Left,
^
/msvc/include/xutility(2301,31): note: candidate template ignored: could not match 'move_iterator' against '_String_view_iterator'
_NODISCARD _CONSTEXPR17 auto operator-(
^
/msvc/include/complex(1265,15): note: candidate template ignored: could not match 'complex' against '_String_view_iterator'
complex<_Ty> operator-(const complex<_Ty>& _Left, const complex<_Ty>& _Right)
^
/msvc/include/complex(1273,15): note: candidate template ignored: could not match 'complex' against '_String_view_iterator'
complex<_Ty> operator-(const complex<_Ty>& _Left, const _Ty& _Right)
^
/msvc/include/complex(1281,15): note: candidate template ignored: could not match 'complex<type-parameter-0-0>' against 'const char *const'
complex<_Ty> operator-(const _Ty& _Left, const complex<_Ty>& _Right)
^
/msvc/include/complex(1349,15): note: candidate function template not viable: requires single argument '_Left', but 2 arguments were provided
complex<_Ty> operator-(const complex<_Ty>& _Left)
^
In file included from ../../../../../src/PlanLibrary.cc:1:
In file included from ../../../../../src/PlanLibrary.h:5:
In file included from ../../../../../projectname/include/library/PlanLibrary.hpp:11:
In file included from ../../../../../projectname/include/library/OnDemandLibraryBase.hpp:4:
In file included from ../../../../../projectname/include/library/ILibrary.hpp:9:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json.hpp:8:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/value.hpp:7:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/basic_value.hpp:21:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/internal/format.hpp:17:
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/demangle.hpp(44,45): error: no return statement in constexpr function
[[nodiscard]] constexpr std::string_view demangle() noexcept
^
Note: including file: ../../../../../projectname/include/taocpp/json/include/tao/json/internal/get_by_enum.hpp
In file included from ../../../../../src/PlanLibrary.cc:1:
In file included from ../../../../../src/PlanLibrary.h:5:
In file included from ../../../../../projectname/include/library/PlanLibrary.hpp:11:
In file included from ../../../../../projectname/include/library/OnDemandLibraryBase.hpp:4:
In file included from ../../../../../projectname/include/library/ILibrary.hpp:9:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/../json.hpp:8:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/../value.hpp:7:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/binding/internal/../../basic_value.hpp:32:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp:17:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/events/../external/pegtl.hpp:10:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp:11:
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(43,68): error: no matching function for call to 'demangle'
throw parse_error( "parse error matching " + std::string( internal::demangle< Rule >() ), in );
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/raise.hpp(40,24): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_escaped>::raise<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
Control< T >::raise( static_cast< const Input& >( in ), st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/must.hpp(61,43): note: in instantiation of function template specialization 'tao::json::pegtl::internal::raise<tao::json::internal::pointer_escaped>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
(void)raise< Rule >::template match< A, rewind_mode::dontcare, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(43,32): note: in instantiation of function template specialization 'tao::json::pegtl::internal::must<tao::json::internal::pointer_escaped>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Rule::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::pegtl::internal::must<tao::json::internal::pointer_escaped>, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::pegtl::internal::must<tao::json::internal::pointer_escaped>, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/if_must.hpp(36,56): note: (skipping 32 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
(void)( Control< must< Rules > >::template match< A, M, Action, Control >( in, st... ) && ... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(68,79): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
if( duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::control>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp(29,40): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_grammar>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Control< Rule >::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp(203,17): note: in instantiation of function template specialization 'tao::json::pegtl::parse<tao::json::internal::pointer_grammar, internal::pointer_action, normal, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *> &, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
pegtl::parse< internal::pointer_grammar, internal::pointer_action >( in, vector(), t );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../analysis/../internal/demangle.hpp(44,45): note: candidate template ignored: substitution failure [with T = tao::json::internal::pointer_escaped]
[[nodiscard]] constexpr std::string_view demangle() noexcept
^
In file included from ../../../../../src/PlanLibrary.cc:1:
In file included from ../../../../../src/PlanLibrary.h:5:
In file included from ../../../../../projectname/include/library/PlanLibrary.hpp:11:
In file included from ../../../../../projectname/include/library/OnDemandLibraryBase.hpp:4:
In file included from ../../../../../projectname/include/library/ILibrary.hpp:9:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/../json.hpp:8:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/../value.hpp:7:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/binding/internal/../../basic_value.hpp:32:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp:17:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/events/../external/pegtl.hpp:10:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp:11:
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(43,68): error: no matching function for call to 'demangle'
throw parse_error( "parse error matching " + std::string( internal::demangle< Rule >() ), in );
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/raise.hpp(40,24): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_token>::raise<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
Control< T >::raise( static_cast< const Input& >( in ), st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/must.hpp(61,43): note: in instantiation of function template specialization 'tao::json::pegtl::internal::raise<tao::json::internal::pointer_token>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
(void)raise< Rule >::template match< A, rewind_mode::dontcare, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(43,32): note: in instantiation of function template specialization 'tao::json::pegtl::internal::must<tao::json::internal::pointer_token>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Rule::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::pegtl::internal::must<tao::json::internal::pointer_token>, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::pegtl::internal::must<tao::json::internal::pointer_token>, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/must.hpp(37,54): note: (skipping 12 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
return ( Control< must< Rules > >::template match< A, M, Action, Control >( in, st... ) && ... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(68,79): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
if( duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::control>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp(29,40): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_grammar>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Control< Rule >::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp(203,17): note: in instantiation of function template specialization 'tao::json::pegtl::parse<tao::json::internal::pointer_grammar, internal::pointer_action, normal, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *> &, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
pegtl::parse< internal::pointer_grammar, internal::pointer_action >( in, vector(), t );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../analysis/../internal/demangle.hpp(44,45): note: candidate template ignored: substitution failure [with T = tao::json::internal::pointer_token]
[[nodiscard]] constexpr std::string_view demangle() noexcept
^
In file included from ../../../../../src/PlanLibrary.cc:1:
In file included from ../../../../../src/PlanLibrary.h:5:
In file included from ../../../../../projectname/include/library/PlanLibrary.hpp:11:
In file included from ../../../../../projectname/include/library/OnDemandLibraryBase.hpp:4:
In file included from ../../../../../projectname/include/library/ILibrary.hpp:9:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/../json.hpp:8:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/../value.hpp:7:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/binding/internal/../../basic_value.hpp:32:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp:17:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/events/../external/pegtl.hpp:10:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp:11:
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(43,68): error: no matching function for call to 'demangle'
throw parse_error( "parse error matching " + std::string( internal::demangle< Rule >() ), in );
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/raise.hpp(40,24): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_slash>::raise<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
Control< T >::raise( static_cast< const Input& >( in ), st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/must.hpp(61,43): note: in instantiation of function template specialization 'tao::json::pegtl::internal::raise<tao::json::internal::pointer_slash>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
(void)raise< Rule >::template match< A, rewind_mode::dontcare, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(43,32): note: in instantiation of function template specialization 'tao::json::pegtl::internal::must<tao::json::internal::pointer_slash>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Rule::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::pegtl::internal::must<tao::json::internal::pointer_slash>, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::pegtl::internal::must<tao::json::internal::pointer_slash>, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/must.hpp(37,54): note: (skipping 12 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
return ( Control< must< Rules > >::template match< A, M, Action, Control >( in, st... ) && ... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(68,79): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
if( duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::control>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp(29,40): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_grammar>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Control< Rule >::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp(203,17): note: in instantiation of function template specialization 'tao::json::pegtl::parse<tao::json::internal::pointer_grammar, internal::pointer_action, normal, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *> &, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
pegtl::parse< internal::pointer_grammar, internal::pointer_action >( in, vector(), t );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../analysis/../internal/demangle.hpp(44,45): note: candidate template ignored: substitution failure [with T = tao::json::internal::pointer_slash]
[[nodiscard]] constexpr std::string_view demangle() noexcept
^
In file included from ../../../../../src/PlanLibrary.cc:1:
In file included from ../../../../../src/PlanLibrary.h:5:
In file included from ../../../../../projectname/include/library/PlanLibrary.hpp:11:
In file included from ../../../../../projectname/include/library/OnDemandLibraryBase.hpp:4:
In file included from ../../../../../projectname/include/library/ILibrary.hpp:9:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/../json.hpp:8:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/../value.hpp:7:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/binding/internal/../../basic_value.hpp:32:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp:17:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/events/../external/pegtl.hpp:10:
In file included from ../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp:11:
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(43,68): error: no matching function for call to 'demangle'
throw parse_error( "parse error matching " + std::string( internal::demangle< Rule >() ), in );
^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/raise.hpp(40,24): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_rule>::raise<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
Control< T >::raise( static_cast< const Input& >( in ), st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/must.hpp(61,43): note: in instantiation of function template specialization 'tao::json::pegtl::internal::raise<tao::json::internal::pointer_rule>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::dontcare, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
(void)raise< Rule >::template match< A, rewind_mode::dontcare, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(43,32): note: in instantiation of function template specialization 'tao::json::pegtl::internal::must<tao::json::internal::pointer_rule>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Rule::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/duseltronik.hpp(68,79): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::nothing>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
if( duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../match.hpp(68,74): note: in instantiation of function template specialization 'tao::json::pegtl::internal::duseltronik<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::internal::dusel_mode::control>::match<tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/jaxn/internal/../../external/pegtl/normal.hpp(80,46): note: in instantiation of function template specialization 'tao::json::pegtl::match<tao::json::internal::pointer_grammar, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return TAO_JSON_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/ubjson/events/../../external/pegtl/parse.hpp(29,40): note: in instantiation of function template specialization 'tao::json::pegtl::normal<tao::json::internal::pointer_grammar>::match<tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, pointer_action, normal, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *>, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
return Control< Rule >::template match< A, M, Action, Control >( in, st... );
^
../../../../../projectname/include/taocpp/json/include/tao/json/contrib/../pointer.hpp(203,17): note: in instantiation of function template specialization 'tao::json::pegtl::parse<tao::json::internal::pointer_grammar, internal::pointer_action, normal, tao::json::pegtl::apply_mode::action, tao::json::pegtl::rewind_mode::required, tao::json::pegtl::memory_input<tao::json::pegtl::tracking_mode::lazy, tao::json::pegtl::ascii::eol::lf_crlf, const char *> &, std::vector<tao::json::token, std::allocator<tao::json::token> > &, std::basic_string<char, std::char_traits<char>, std::allocator<char> > &>' requested here
pegtl::parse< internal::pointer_grammar, internal::pointer_action >( in, vector(), t );
^
../../../../../projectname/include/taocpp/json/include/tao/json/internal/../external/pegtl/internal/../analysis/../internal/demangle.hpp(44,45): note: candidate template ignored: substitution failure [with T = tao::json::internal::pointer_rule]
[[nodiscard]] constexpr std::string_view demangle() noexcept
^
6 errors generated.
When tao/json is compiled with clang-cl for Windows (LLVM 10.x), the following error is thrown:
Error:
tao/json/span.hpp:546:10: fatal error: 'span' file not found
The problem is that <span>
is not available in the MSVC standard c++ library.
The condition here must probably be changed:
https://github.com/taocpp/json/blob/master/include/tao/json/span.hpp#L7
What I wanted is something like:
tao::json::value v({ "position" , { {"x", x }, {"y", y} } });
...
if(is_rotated) {
v.some_appending_function({"rotation", {"angle", a }});
}
How to achieve this?
We found that in nativejson-benchmark, while building in 32-bit mode, it generates this static assertion failure.
../../thirdparty/taocppjson/include/tao/json/internal/asserts.hh:16:1: error: static_assert failed "internal consistency"
static_assert( sizeof( signed long ) == 8, "internal consistency" );
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
../../thirdparty/taocppjson/include/tao/json/internal/asserts.hh:17:1: error: static_assert failed "internal consistency"
static_assert( sizeof( unsigned long ) == 8, "internal consistency" );
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tao:json::from_string does not support wstring at the moment:
std::wstring json_string;
tao::json::from_string(json_string)
include\tao\json\from_string.hpp(22): error C2664: 'void tao::json::events::from_string<tao::json::events::to_basic_valuetao::json::traits,tao::json::internal::empty_base,>(Consumer &,const tao::string_view)': cannot convert argument 2 from 'const std::wstring' to 'const tao::string_view'
Maybe this can be fixed by adding overloads for the other string_view classes in
include\tao\json\events\from_string.hpp
void from_string( Consumer& consumer, const tao::string_view data, Ts&&... ts )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.