[Bug] getters have bad formatting
- Dominant language
- C++
- Stars
- 4
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
jsonparser.cpp has logic errors and issues with getters
The getters should be something like
```c
double JsonValue::getNumber() const {
if (std::holds_alternative(value_)) { // Was checking for bool
return std::get(value_);
}
throw std::runtime_error("Cannot retrieve number value, types mismatch");
}
const JsonArray& JsonValue::getArray() const {
if (std::holds_alternative(value_)) { // Was checking for bool
return std::get(value_);
}
throw std::runtime_error("Cannot retrieve array value, types mismatch");
}
const JsonObject& JsonValue::getObject() const {
if (std::holds_alternative(value_)) { // Was checking for bool
return std::get(value_);
}
throw std::runtime_error("Cannot retrieve object value, types mismatch");
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.