mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 00:38:08 +08:00
Merge pull request #60 from ToruNiina/string-view
support std::string_view
This commit is contained in:
@@ -188,6 +188,12 @@ See also [underlying types](#underlying-types).
|
||||
|
||||
NOTE: To enable to get a reference, conversions between Float and Integer are not supported.
|
||||
|
||||
After C++17, you can use `std::string_view` to get a string from a `toml::value`.
|
||||
|
||||
```cpp
|
||||
const auto sv = toml::get<std::string_view>(tab.at("key"));
|
||||
```
|
||||
|
||||
### In the case of type error
|
||||
|
||||
If you pass an invalid type to `toml::get`, `toml::type_error` will be thrown.
|
||||
|
Reference in New Issue
Block a user