-
|
Hello, when I try to use the to_string method as explained in the basics.md (literal copy and paste) I can't get it to compile. What could be the reason and what's the correct usage? Thanks in advance. I have tried also in a clean test file as follows: #include "simdjson.h"
#include <iostream>
int main(){
simdjson::ondemand::parser parser;
auto cars_json = R"( { "test": "result" } )"_padded;
simdjson::ondemand::document doc = parser.iterate(cars_json);
std::cout << simdjson::to_string(doc["test"]) << std::endl;
return 0;
}When I try to compile it, here is the output that I got: gcc test.cpp -o test
In file included from test.cpp:1:0:
simdjson.h:6243:38: warning: βIteratorβ is deprecated [-Wdeprecated-declarations]
inline Iterator(const Iterator &o) noexcept;
^~~~~~~~
simdjson.h:6246:49: warning: βIteratorβ is deprecated: Use the new DOM navigation API instead (see doc/basics.md) [-Wdeprecated-declarations]
inline Iterator& operator=(const Iterator&) = delete;
^~~~~~
simdjson.h:6240:97: note: declared here
class [[deprecated("Use the new DOM navigation API instead (see doc/basics.md)")]] dom::parser::Iterator {
^~~~~~~~
simdjson.h:6246:49: warning: βIteratorβ is deprecated [-Wdeprecated-declarations]
inline Iterator& operator=(const Iterator&) = delete;
^~~~~~
In file included from test.cpp:1:0:
simdjson.h: In instantiation of βstd::string simdjson::to_string(T) [with T = simdjson::fallback::ondemand::value; std::string = std::basic_string<char>]β:
simdjson.h:5966:21: required from βstd::string simdjson::to_string(simdjson::simdjson_result<T>) [with T = simdjson::fallback::ondemand::value; std::string = std::basic_string<char>]β
test.cpp:9:49: required from here
simdjson.h:5958:5: error: no matching function for call to βsimdjson::internal::string_builder<>::append(simdjson::fallback::ondemand::value&)β
sb.append(x);
^~
In file included from test.cpp:1:0:
simdjson.h:8888:13: note: candidate: void simdjson::internal::string_builder<T>::append(simdjson::dom::element) [with formatter = simdjson::internal::mini_formatter]
inline void string_builder<serializer>::append(simdjson::dom::element value) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
simdjson.h:8888:13: note: no known conversion for argument 1 from βsimdjson::fallback::ondemand::valueβ to βsimdjson::dom::elementβ
simdjson.h:9034:13: note: candidate: void simdjson::internal::string_builder<T>::append(simdjson::dom::array) [with formatter = simdjson::internal::mini_formatter]
inline void string_builder<serializer>::append(simdjson::dom::array value) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
simdjson.h:9034:13: note: no known conversion for argument 1 from βsimdjson::fallback::ondemand::valueβ to βsimdjson::dom::arrayβ
simdjson.h:9019:13: note: candidate: void simdjson::internal::string_builder<T>::append(simdjson::dom::object) [with formatter = simdjson::internal::mini_formatter]
inline void string_builder<serializer>::append(simdjson::dom::object value) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
simdjson.h:9019:13: note: no known conversion for argument 1 from βsimdjson::fallback::ondemand::valueβ to βsimdjson::dom::objectβ
simdjson.h:9049:29: note: candidate: void simdjson::internal::string_builder<T>::append(simdjson::dom::key_value_pair) [with formatter = simdjson::internal::mini_formatter]
simdjson_really_inline void string_builder<serializer>::append(simdjson::dom::key_value_pair kv) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
simdjson.h:9049:29: note: no known conversion for argument 1 from βsimdjson::fallback::ondemand::valueβ to βsimdjson::dom::key_value_pairβ |
Beta Was this translation helpful? Give feedback.
Answered by
lemire
Jun 7, 2021
Replies: 1 comment
-
|
The |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bhdurak
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
to_stringmethod has not yet been released. It is marked for the upcoming version 1.0.