Replies: 1 comment 6 replies
-
There should be no problem passing #include "simdjson.h"
#include <iostream>
void f(simdjson::ondemand::value v) {
double val;
if(auto error = v.get_double().get(val)) { std::cout << error << std::endl; return; }
printf("%.0f\n", val);
std::cout << std::hexfloat << val << std::endl;
}
int main(void) {
simdjson::padded_string json = R"( [ 233897314173811950000 ])"_padded;
simdjson::ondemand::parser parser;
simdjson::ondemand::document doc = parser.iterate(json);
f(doc.at(0));
return EXIT_SUCCESS;
} The |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. Is there a way to forward declaration in the header?
Is it better to use a template function or something else?
For example, I want to declare an API that uses
simdjson::ondemand::value
as an argument.This is an error because the namespace differs from the actual definition.
This is interpreted as a namespace where
SIMDJSON_IMPLEMENTATION
is not a define.Enumerating by all architectures may be ok, but hard to maintain.
Beta Was this translation helpful? Give feedback.
All reactions