1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-13 20:21:48 +03:00
This commit is contained in:
Niels
2015-07-06 23:21:54 +02:00
parent e070aed8a7
commit 12d174d424
3 changed files with 87 additions and 30 deletions

View File

@ -5248,16 +5248,22 @@ class basic_json
it)
: std::reverse_iterator<basic_json::iterator>(it) {}
reverse_iterator(const std::reverse_iterator<typename basic_json::iterator>& it)
: std::reverse_iterator<typename basic_json::iterator>(it)
{}
/// return the key of an object iterator
typename object_t::key_type key() const
{
return this->base().key();
auto it = --this->base();
return it.key();
}
/// return the value of an iterator
reference value() const
{
return this->base().operator * ();
auto it = --this->base();
return it.operator * ();
}
};
@ -5272,13 +5278,15 @@ class basic_json
/// return the key of an object iterator
typename object_t::key_type key() const
{
return this->base().key();
auto it = --this->base();
return it.key();
}
/// return the value of an iterator
const_reference value() const
{
return this->base().operator * ();
auto it = --this->base();
return it.operator * ();
}
};