Added as<JsonArray>() as a synonym for as<JsonArray&>()... (issue #291)

This commit is contained in:
Benoit Blanchon
2016-07-17 17:22:58 +02:00
parent 2dbd94951c
commit c87a0e97ab
13 changed files with 175 additions and 30 deletions

View File

@ -106,7 +106,7 @@ class JsonObject : public Internals::JsonPrintable<JsonObject>,
// Gets the value associated with the specified key.
template <typename T>
T get(JsonObjectKey key) const {
typename Internals::JsonVariantAs<T>::type get(JsonObjectKey key) const {
node_type* node = getNodeAt(key.c_str());
return node ? node->content.value.as<T>() : JsonVariant::defaultValue<T>();
}