Help Needed #3607
-
I am getting a compiler error (G++) and I am not sure why. I will paste the compiler output at the bottom but it seems to be complaining about the line where I attempt json::parse on an item within an array from a JSON string that I parsed earlier in the code. I can run a for loop on the array and print out a JSON string fine for each item (syntax: "[{"foo": "bar", ...}]"). I will paste the code below any help is greatly appreciated! I have tried passing the direct array ref to the parse method as well as a pointer to it and saving it in an auto variable first but all give the same error. I added some "bold comments" to the code below to show a similar method call working and where the failure was introduced. // My Code void myFunction(std::string query) {
// Access Values
} // GCC Output |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
auto tempCardObj = json::parse(tempCardString.get_ref<const std::string &>()); or auto tempCardObj = json::parse(tempCardString.get<std::string>()); instead. |
Beta Was this translation helpful? Give feedback.
tempCardString
– despite its name – isn't a string. Tryor
auto tempCardObj = json::parse(tempCardString.get<std::string>());
instead.