This provides a simple method to retrieve the value. It does not check if the value exists, as with the operator version.
uint32_t port = config->get_as<uint32_t>("port");
if (port) {
exampleFunction(port.value());
} else {
// Handle error
}
I understand this might not be a change you are interested in merging, but I just wanted to make a PR since it something that I personally would like to see in cpptoml.
If you are interested in merging this, I can update this PR with documentation.
This provides a simple method to retrieve the value. It does not check if the value exists, as with the operator version.
I understand this might not be a change you are interested in merging, but I just wanted to make a PR since it something that I personally would like to see in cpptoml.
If you are interested in merging this, I can update this PR with documentation.