cleanup
This commit is contained in:
parent
70493a10d1
commit
fcbd984e0f
2 changed files with 52 additions and 44 deletions
48
src/json.hpp
48
src/json.hpp
|
@ -3767,6 +3767,32 @@ class basic_json
|
||||||
return const_reverse_iterator(cbegin());
|
return const_reverse_iterator(cbegin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// forward declaration
|
||||||
|
template<typename IteratorType> class iteration_proxy;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/*!
|
||||||
|
@brief wrapper to access iterator member functions in range-based for
|
||||||
|
|
||||||
|
This functuion allows to access @ref iterator::key() and @ref
|
||||||
|
iterator::value() during range-based for loops. In these loops, a reference
|
||||||
|
to the JSON values is returned, so there is no access to the underlying
|
||||||
|
iterator.
|
||||||
|
*/
|
||||||
|
static iteration_proxy<iterator> iterator_wrapper(reference cont)
|
||||||
|
{
|
||||||
|
return iteration_proxy<iterator>(cont);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@copydoc iterator_wrapper(reference)
|
||||||
|
*/
|
||||||
|
static iteration_proxy<const_iterator> iterator_wrapper(const_reference cont)
|
||||||
|
{
|
||||||
|
return iteration_proxy<const_iterator>(cont);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6248,28 +6274,6 @@ class basic_json
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
|
||||||
/*!
|
|
||||||
@brief wrapper to access iterator member functions in range-based for
|
|
||||||
|
|
||||||
This functuion allows to access @ref iterator::key() and @ref
|
|
||||||
iterator::value() during range-based for loops. In these loops, a reference
|
|
||||||
to the JSON values is returned, so there is no access to the underlying
|
|
||||||
iterator.
|
|
||||||
*/
|
|
||||||
static iteration_proxy<iterator> iterator_wrapper(reference cont)
|
|
||||||
{
|
|
||||||
return iteration_proxy<iterator>(cont);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@copydoc iterator_wrapper(reference)
|
|
||||||
*/
|
|
||||||
static iteration_proxy<const_iterator> iterator_wrapper(const_reference cont)
|
|
||||||
{
|
|
||||||
return iteration_proxy<const_iterator>(cont);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|
|
@ -3767,6 +3767,32 @@ class basic_json
|
||||||
return const_reverse_iterator(cbegin());
|
return const_reverse_iterator(cbegin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// forward declaration
|
||||||
|
template<typename IteratorType> class iteration_proxy;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/*!
|
||||||
|
@brief wrapper to access iterator member functions in range-based for
|
||||||
|
|
||||||
|
This functuion allows to access @ref iterator::key() and @ref
|
||||||
|
iterator::value() during range-based for loops. In these loops, a reference
|
||||||
|
to the JSON values is returned, so there is no access to the underlying
|
||||||
|
iterator.
|
||||||
|
*/
|
||||||
|
static iteration_proxy<iterator> iterator_wrapper(reference cont)
|
||||||
|
{
|
||||||
|
return iteration_proxy<iterator>(cont);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@copydoc iterator_wrapper(reference)
|
||||||
|
*/
|
||||||
|
static iteration_proxy<const_iterator> iterator_wrapper(const_reference cont)
|
||||||
|
{
|
||||||
|
return iteration_proxy<const_iterator>(cont);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6248,28 +6274,6 @@ class basic_json
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
|
||||||
/*!
|
|
||||||
@brief wrapper to access iterator member functions in range-based for
|
|
||||||
|
|
||||||
This functuion allows to access @ref iterator::key() and @ref
|
|
||||||
iterator::value() during range-based for loops. In these loops, a reference
|
|
||||||
to the JSON values is returned, so there is no access to the underlying
|
|
||||||
iterator.
|
|
||||||
*/
|
|
||||||
static iteration_proxy<iterator> iterator_wrapper(reference cont)
|
|
||||||
{
|
|
||||||
return iteration_proxy<iterator>(cont);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@copydoc iterator_wrapper(reference)
|
|
||||||
*/
|
|
||||||
static iteration_proxy<const_iterator> iterator_wrapper(const_reference cont)
|
|
||||||
{
|
|
||||||
return iteration_proxy<const_iterator>(cont);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
|
Loading…
Reference in a new issue