Hello again. :)
If we have code:
#include "json.hpp"
#include <iostream>
using nlohmann::json;
int main()
{
json k = { {"a", "A"}, {"a", "AA"} };
std::cout << k.count("a") << '\n';
return 0;
}
Accordingly to comment:
/// returns the number of occurrences of a key in an object
inline size_type count(typename object_t::key_type key) const
{
// return 0 for all nonobject types
return (m_type == value_t::object) ? m_value.object->count(key) : 0;
}
we should got "2" in program output. By I got "1".
Hello again. :)
If we have code:
Accordingly to comment:
we should got "2" in program output. By I got "1".