diff --git a/include/json.hpp b/include/json.hpp index 2208d05..2fd001f 100644 --- a/include/json.hpp +++ b/include/json.hpp @@ -148,6 +148,9 @@ class basic_value template bool is() const noexcept; + template + bool all() const; + bool contains(const string_t& key) const; bool contains(size_t pos) const; bool exists(const string_t& key) const { return contains(key); } @@ -181,6 +184,12 @@ class basic_value string_t as_string() const; const basic_array& as_array() const; const basic_object& as_object() const; + + template typename collection_t = std::vector> + collection_t as_collection() const; + template typename map_t = std::map> + map_t as_map() const; + template value_t as() const; @@ -210,21 +219,14 @@ class basic_value return format(indent, 0); } - template - bool all() const; - template typename collection_t = std::vector> - collection_t as_collection() const; - template typename map_t = std::map> - map_t as_map() const; - template typename vector_t = std::vector> - // deprecated, please use as_collection instead. + // deprecated, please use `as_collection` instead. vector_t to_vector() const { return to_vector(); } template typename map_t = std::map> - // deprecated, please use as_map instead. + // deprecated, please use `as_map` instead. map_t to_map() const { return as_map();