Greg Marr
Greg Marr
Which of these two lines causes the error? Can you get a stack trace? ``` nlohmann::json json = foos; std::cout
It is most likely a bus error caused by an unaligned memory access. Here is the bottom of the call stack: ``` #0 nlohmann::detail::to_json_fn::operator()() #1 nlohmann::adl_serializer::to_json() #2 json::json(...) #3 nlohmann::detail::json_ref::json_ref(...)...
>I can also confirm that the bus error still persists with the alternative conversion logic that you suggested. Has the stack trace changed? There should be a different bus error...
Do either of these changes alter the behavior? ``` void to_json(nlohmann::json& json, const Foo& foo) { double bar1 = foo.bar1; json["bar1"] = bar1; json["bar2"] = foo.bar2; } void to_json(nlohmann::json& json,...
> [@gregmarr](https://github.com/gregmarr) Both of the changes that you suggested work (no bus error). That's good. I think it has to do with the functions taking a `double &` instead of...
I can't think of any changes that we could make at this point.
I recommend viewing this with whitespace ignored, as it is then a single line move instead of multiple lines moved.
Are you looking to embed the content of the `cpp2util.h` and `cpp2regex.h` into the generated cpp1 file?
That seems to be a very specialized use case. Personally, I think sending those two headers along with your source file would be simple enough. Most of the time it...
The `cpp2util.h` is 3100+ lines. Would you be able to submit a C++ file that large to the online judge?