Iterator class for the variant. More...
#include <variant.hpp>
Public Types | |
enum | TYPE { TYPE_NULL, TYPE_LIST, TYPE_MAP } |
typedef variant | value_type |
typedef std::bidirectional_iterator_tag | iterator_category |
typedef variant & | reference |
typedef variant * | pointer |
typedef int | difference_type |
Public Member Functions | |
variant_iterator () | |
Constructor for a TYPE_NULL variant. More... | |
variant_iterator (const std::vector< variant >::iterator &iter) | |
Constructor for a TYPE_LIST variant. More... | |
variant_iterator (const std::map< variant, variant >::iterator &iter) | |
Constructor for a TYPE_MAP variant. More... | |
variant_iterator (const variant_iterator &) | |
variant | operator* () const |
variant_iterator & | operator++ () |
variant_iterator | operator++ (int) |
variant_iterator & | operator-- () |
variant_iterator | operator-- (int) |
variant_iterator & | operator= (const variant_iterator &that) |
bool | operator== (const variant_iterator &that) const |
bool | operator!= (const variant_iterator &that) const |
Private Attributes | |
TYPE | type_ |
std::vector< variant >::iterator | list_iterator_ |
std::map< variant, variant > ::iterator | map_iterator_ |
Iterator class for the variant.
Depending on the type_
the list_iterator_
and the map_iterator_
are a valid iterator or singular. Since most actions on singular iterators result in Undefined Behavior care should be taken when copying the list_iterator_
and map_iterator_
.
Definition at line 188 of file variant.hpp.
typedef int variant_iterator::difference_type |
Definition at line 194 of file variant.hpp.
typedef std::bidirectional_iterator_tag variant_iterator::iterator_category |
Definition at line 191 of file variant.hpp.
typedef variant* variant_iterator::pointer |
Definition at line 193 of file variant.hpp.
typedef variant& variant_iterator::reference |
Definition at line 192 of file variant.hpp.
typedef variant variant_iterator::value_type |
Definition at line 190 of file variant.hpp.
Enumerator | |
---|---|
TYPE_NULL | |
TYPE_LIST | |
TYPE_MAP |
Definition at line 230 of file variant.hpp.
variant_iterator::variant_iterator | ( | ) |
Constructor for a TYPE_NULL variant.
Definition at line 83 of file variant.cpp.
|
explicit |
Constructor for a TYPE_LIST variant.
iter
is not singular.iter | Iterator to initialize list_iterator_ with. |
Definition at line 110 of file variant.cpp.
Constructor for a TYPE_MAP variant.
iter
is not singular.iter | Iterator to initialize map_iterator_ with. |
Definition at line 118 of file variant.cpp.
variant_iterator::variant_iterator | ( | const variant_iterator & | iter | ) |
Definition at line 90 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, TYPE_MAP, and TYPE_NULL.
bool variant_iterator::operator!= | ( | const variant_iterator & | that | ) | const |
Definition at line 234 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, TYPE_MAP, and TYPE_NULL.
variant variant_iterator::operator* | ( | ) | const |
Definition at line 126 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, and TYPE_MAP.
variant_iterator & variant_iterator::operator++ | ( | ) |
Definition at line 140 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, and TYPE_MAP.
variant_iterator variant_iterator::operator++ | ( | int | ) |
Definition at line 153 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, and TYPE_MAP.
variant_iterator & variant_iterator::operator-- | ( | ) |
Definition at line 167 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, and TYPE_MAP.
variant_iterator variant_iterator::operator-- | ( | int | ) |
Definition at line 180 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, and TYPE_MAP.
variant_iterator & variant_iterator::operator= | ( | const variant_iterator & | that | ) |
Definition at line 194 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, TYPE_MAP, and TYPE_NULL.
bool variant_iterator::operator== | ( | const variant_iterator & | that | ) | const |
Definition at line 216 of file variant.cpp.
References list_iterator_, map_iterator_, type_, TYPE_LIST, TYPE_MAP, and TYPE_NULL.
|
private |
Definition at line 233 of file variant.hpp.
Referenced by operator!=(), operator*(), operator++(), operator--(), operator=(), operator==(), and variant_iterator().
Definition at line 234 of file variant.hpp.
Referenced by operator!=(), operator*(), operator++(), operator--(), operator=(), operator==(), and variant_iterator().
|
private |
Definition at line 232 of file variant.hpp.
Referenced by operator!=(), operator*(), operator++(), operator--(), operator=(), operator==(), and variant_iterator().