diff --git a/src/json.hpp b/src/json.hpp index 599e9d8fb..606dc5629 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -1003,7 +1003,7 @@ class basic_json */ template ::value and + std::is_constructible::value and std::is_constructible::value, int>::type = 0> basic_json(const CompatibleObjectType& val) @@ -2203,7 +2203,7 @@ class basic_json /// get an object (explicit) template ::value and + std::is_convertible::value and std::is_convertible::value , int>::type = 0> T get_impl(T*) const @@ -2751,7 +2751,7 @@ class basic_json @since version 1.0.0 */ - reference at(const typename object_t::key_type& key) + reference at(const StringType& key) { // at only works for objects if (is_object()) @@ -2798,7 +2798,7 @@ class basic_json @since version 1.0.0 */ - const_reference at(const typename object_t::key_type& key) const + const_reference at(const StringType& key) const { // at only works for objects if (is_object()) @@ -2928,7 +2928,7 @@ class basic_json @since version 1.0.0 */ - reference operator[](const typename object_t::key_type& key) + reference operator[](const StringType& key) { // implicitly convert null to object if (is_null()) @@ -2975,7 +2975,7 @@ class basic_json @since version 1.0.0 */ - const_reference operator[](const typename object_t::key_type& key) const + const_reference operator[](const StringType& key) const { // [] only works for objects if (is_object()) @@ -3133,7 +3133,7 @@ class basic_json std::enable_if< std::is_convertible::value , int>::type = 0> - ValueType value(const typename object_t::key_type& key, ValueType default_value) const + ValueType value(const StringType& key, ValueType default_value) const { // at only works for objects if (is_object()) @@ -3159,7 +3159,7 @@ class basic_json @brief overload for a default value of type const char* @copydoc basic_json::value() */ - string_t value(const typename object_t::key_type& key, const char* default_value) const + string_t value(const StringType& key, const char* default_value) const { return value(key, string_t(default_value)); } @@ -3469,7 +3469,7 @@ class basic_json @since version 1.0.0 */ - size_type erase(const typename object_t::key_type& key) + size_type erase(const StringType& key) { // this erase only works for objects if (is_object()) @@ -3541,7 +3541,7 @@ class basic_json @since version 1.0.0 */ - iterator find(typename object_t::key_type key) + iterator find(StringType key) { auto result = end(); @@ -3557,7 +3557,7 @@ class basic_json @brief find an element in a JSON object @copydoc find(typename object_t::key_type) */ - const_iterator find(typename object_t::key_type key) const + const_iterator find(StringType key) const { auto result = cend(); @@ -3587,7 +3587,7 @@ class basic_json @since version 1.0.0 */ - size_type count(typename object_t::key_type key) const + size_type count(StringType key) const { // return 0 for all nonobject types return is_object() ? m_value.object->count(key) : 0; @@ -4220,7 +4220,7 @@ class basic_json @since version 1.0.0 */ - void push_back(const typename object_t::value_type& val) + void push_back(const std::pair& val) { // push_back only works for null objects or objects if (not(is_null() or is_object())) @@ -4241,9 +4241,9 @@ class basic_json /*! @brief add an object to an object - @copydoc push_back(const typename object_t::value_type&) + @copydoc push_back(const std::pair&) */ - reference operator+=(const typename object_t::value_type& val) + reference operator+=(const std::pair& val) { push_back(val); return operator[](val.first); @@ -6083,7 +6083,7 @@ class basic_json } /// return the key of an object iterator - typename object_t::key_type key() const + StringType key() const { if (m_object->is_object()) { @@ -6340,7 +6340,7 @@ class basic_json } /// return the key of an object iterator - typename object_t::key_type key() const + StringType key() const { auto it = --this->base(); return it.key();