Closed zmb3 closed 8 years ago
Sounds reasonable. However, I don't like to change toml::Array
type.
I would like to avoid adding the second type to get()
template, because the second type makes sense only when the first type is toml::Array. Probably, we would like to have something like v.get<std::vector<int>>("foo")
? Isn't it more sophisticated?
Yeah that sounds great! On Feb 8, 2016 9:31 PM, "MAYAH" notifications@github.com wrote:
Sounds reasonable. However, I don't like to change toml::Array type.
I would like to avoid adding the second type to get() template, because the second type makes sense only when the first type is toml::Array. Probably, we would like to have something like v.getstd::vector
("foo")? Isn't it more sophisticated? — Reply to this email directly or view it on GitHub https://github.com/mayah/tinytoml/issues/7#issuecomment-181674492.
It would be nice if there were an easier way to get the elements from a
toml::Array
. Since an Array is just astd::vector<toml::Value>
, you have to manually convert eachValue
element to the underlying type.I would like to be able to do something like this:
Would something like this be a good candidate for the library?
Perhaps another option would be to make
Array
a class and not an alias for vector, and then you could addis<T>()
andas<T>()
methods similar totoml::Value
.