Closed TerryHoCQ closed 11 months ago
In order to asses your issue, we need the following information:
What is the issue you have?
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
What is the expected behavior?
And what is the actual behavior instead?
Which compiler and operating system are you using? Is it a supported compiler?
Did you use a released version of the library or the version from the develop
branch?
If you experience a compilation error: can you compile and run the unit tests?
float value = j["value"].get<float>();
float value = j["value"].get
The library does not provide string-to-float conversion.
Description
include
include
include <nlohmann/json.hpp>
using json = nlohmann::json;
int main() { std::string json_str = R"({"value": "3.1415"})"; json j = json::parse(json_str);
}
Reproduction steps
include
include
include <nlohmann/json.hpp>
using json = nlohmann::json;
int main() { std::string json_str = R"({"value": "3.1415"})"; json j = json::parse(json_str);
}
Expected vs. actual results
include
include
include <nlohmann/json.hpp>
using json = nlohmann::json;
int main() { std::string json_str = R"({"value": "3.1415"})"; json j = json::parse(json_str);
}
Minimal code example
Error messages
No response
Compiler and operating system
vs20019+WIN10
Library version
v3.11.2
Validation
develop
branch is used.