All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
nlohmann::detail::json_reverse_iterator< Base > Class Template Reference

a template for a reverse iterator class More...

#include <json.hpp>

Inheritance diagram for nlohmann::detail::json_reverse_iterator< Base >:

Public Types

using difference_type = std::ptrdiff_t
 
using base_iterator = std::reverse_iterator< Base >
 shortcut to the reverse iterator adapter More...
 
using reference = typename Base::reference
 the reference type for the pointed-to element More...
 

Public Member Functions

 json_reverse_iterator (const typename base_iterator::iterator_type &it) noexcept
 create reverse iterator from iterator More...
 
 json_reverse_iterator (const base_iterator &it) noexcept
 create reverse iterator from base class More...
 
json_reverse_iterator const operator++ (int)
 post-increment (it++) More...
 
json_reverse_iteratoroperator++ ()
 pre-increment (++it) More...
 
json_reverse_iterator const operator-- (int)
 post-decrement (it–) More...
 
json_reverse_iteratoroperator-- ()
 pre-decrement (–it) More...
 
json_reverse_iteratoroperator+= (difference_type i)
 add to iterator More...
 
json_reverse_iterator operator+ (difference_type i) const
 add to iterator More...
 
json_reverse_iterator operator- (difference_type i) const
 subtract from iterator More...
 
difference_type operator- (const json_reverse_iterator &other) const
 return difference More...
 
reference operator[] (difference_type n) const
 access to successor More...
 
auto key () const -> decltype(std::declval< Base >().key())
 return the key of an object iterator More...
 
reference value () const
 return the value of an iterator More...
 

Detailed Description

template<typename Base>
class nlohmann::detail::json_reverse_iterator< Base >

a template for a reverse iterator class

Template Parameters
Basethe base iterator type to reverse. Valid types are iterator (to create reverse_iterator) and const_iterator (to create const_reverse_iterator).

The class satisfies the following concept requirements:

Since
version 1.0.0

Definition at line 9982 of file json.hpp.

Member Typedef Documentation

template<typename Base >
using nlohmann::detail::json_reverse_iterator< Base >::base_iterator = std::reverse_iterator<Base>

shortcut to the reverse iterator adapter

Definition at line 9987 of file json.hpp.

template<typename Base >
using nlohmann::detail::json_reverse_iterator< Base >::difference_type = std::ptrdiff_t

Definition at line 9985 of file json.hpp.

template<typename Base >
using nlohmann::detail::json_reverse_iterator< Base >::reference = typename Base::reference

the reference type for the pointed-to element

Definition at line 9989 of file json.hpp.

Constructor & Destructor Documentation

template<typename Base >
nlohmann::detail::json_reverse_iterator< Base >::json_reverse_iterator ( const typename base_iterator::iterator_type &  it)
inlineexplicitnoexcept

create reverse iterator from iterator

Definition at line 9992 of file json.hpp.

9993  : base_iterator(it) {}
std::reverse_iterator< Base > base_iterator
shortcut to the reverse iterator adapter
Definition: json.hpp:9987
template<typename Base >
nlohmann::detail::json_reverse_iterator< Base >::json_reverse_iterator ( const base_iterator it)
inlineexplicitnoexcept

create reverse iterator from base class

Definition at line 9996 of file json.hpp.

9996 : base_iterator(it) {}
std::reverse_iterator< Base > base_iterator
shortcut to the reverse iterator adapter
Definition: json.hpp:9987

Member Function Documentation

template<typename Base >
auto nlohmann::detail::json_reverse_iterator< Base >::key ( ) const -> decltype(std::declval<Base>().key())
inline

return the key of an object iterator

Definition at line 10053 of file json.hpp.

10054  {
10055  auto it = --this->base();
10056  return it.key();
10057  }
template<typename Base >
json_reverse_iterator nlohmann::detail::json_reverse_iterator< Base >::operator+ ( difference_type  i) const
inline

add to iterator

Definition at line 10029 of file json.hpp.

10030  {
10031  return static_cast<json_reverse_iterator>(base_iterator::operator+(i));
10032  }
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
QuadExpr operator+(double v, const QuadExpr &e)
Definition: QuadExpr.h:37
template<typename Base >
json_reverse_iterator const nlohmann::detail::json_reverse_iterator< Base >::operator++ ( int  )
inline

post-increment (it++)

Definition at line 9999 of file json.hpp.

10000  {
10001  return static_cast<json_reverse_iterator>(base_iterator::operator++(1));
10002  }
base_iterator & operator++()
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
template<typename Base >
json_reverse_iterator& nlohmann::detail::json_reverse_iterator< Base >::operator++ ( )
inline

pre-increment (++it)

Definition at line 10005 of file json.hpp.

10006  {
10007  return static_cast<json_reverse_iterator&>(base_iterator::operator++());
10008  }
base_iterator & operator++()
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
template<typename Base >
json_reverse_iterator& nlohmann::detail::json_reverse_iterator< Base >::operator+= ( difference_type  i)
inline

add to iterator

Definition at line 10023 of file json.hpp.

10024  {
10025  return static_cast<json_reverse_iterator&>(base_iterator::operator+=(i));
10026  }
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
String & operator+=(String &s, VectorDumper< Vector > const &manip)
Appends a string rendering of a vector to the specified string.
Definition: DumpUtils.h:424
template<typename Base >
json_reverse_iterator nlohmann::detail::json_reverse_iterator< Base >::operator- ( difference_type  i) const
inline

subtract from iterator

Definition at line 10035 of file json.hpp.

10036  {
10037  return static_cast<json_reverse_iterator>(base_iterator::operator-(i));
10038  }
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
difference_type operator-(base_iterator const &other) const
template<typename Base >
difference_type nlohmann::detail::json_reverse_iterator< Base >::operator- ( const json_reverse_iterator< Base > &  other) const
inline

return difference

Definition at line 10041 of file json.hpp.

10042  {
10043  return base_iterator(*this) - base_iterator(other);
10044  }
std::reverse_iterator< Base > base_iterator
shortcut to the reverse iterator adapter
Definition: json.hpp:9987
template<typename Base >
json_reverse_iterator const nlohmann::detail::json_reverse_iterator< Base >::operator-- ( int  )
inline

post-decrement (it–)

Definition at line 10011 of file json.hpp.

10012  {
10013  return static_cast<json_reverse_iterator>(base_iterator::operator--(1));
10014  }
base_iterator & operator--()
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
template<typename Base >
json_reverse_iterator& nlohmann::detail::json_reverse_iterator< Base >::operator-- ( )
inline

pre-decrement (–it)

Definition at line 10017 of file json.hpp.

10018  {
10019  return static_cast<json_reverse_iterator&>(base_iterator::operator--());
10020  }
base_iterator & operator--()
json_reverse_iterator(const typename base_iterator::iterator_type &it) noexcept
create reverse iterator from iterator
Definition: json.hpp:9992
template<typename Base >
reference nlohmann::detail::json_reverse_iterator< Base >::operator[] ( difference_type  n) const
inline

access to successor

Definition at line 10047 of file json.hpp.

10048  {
10049  return *(this->operator+(n));
10050  }
json_reverse_iterator operator+(difference_type i) const
add to iterator
Definition: json.hpp:10029
template<typename Base >
reference nlohmann::detail::json_reverse_iterator< Base >::value ( ) const
inline

return the value of an iterator

Definition at line 10060 of file json.hpp.

10061  {
10062  auto it = --this->base();
10063  return it.operator * ();
10064  }

The documentation for this class was generated from the following file: