The variant_associative_view::const_iterator allows iteration over an associative container in a variant. More...
#include <variant_associative_view.h>
Public Types | |
using | self_type = const_iterator |
using | value_type = variant |
Public Member Functions | |
const_iterator (const const_iterator &other) | |
Creates a copy of other . More... | |
~const_iterator () | |
Destroys the variant_associative_view::const_iterator. More... | |
const variant | get_key () const |
Returns the current key, stored inside a std::reference_wrapper<T> and copied to a variant. More... | |
const variant | get_value () const |
Returns the current value, stored inside a std::reference_wrapper<T> and copied to a variant. More... | |
const std::pair< variant, variant > | operator * () const |
Returns the underlying key and value stored in a std::pair<key, value> . More... | |
bool | operator!= (const const_iterator &other) const |
Returns true if other points to a different item than this iterator; otherwise returns false. More... | |
const_iterator | operator+ (int i) const |
Returns an iterator to the item at i positions forward from this iterator. More... | |
const_iterator & | operator++ () |
Pre-increment operator advances the iterator to the next item in the container and returns an iterator to the new current item. More... | |
const_iterator | operator++ (int) |
Post-increment operator advances the iterator to the next item in the container and returns an iterator to the previously current item. More... | |
const_iterator & | operator+= (int i) |
Advances the iterator by i items. More... | |
const_iterator | operator- (int i) const |
Returns an iterator to the item at i positions backward from this iterator. More... | |
const_iterator & | operator-- () |
Pre-decrement operator makes the preceding item current and returns an iterator to the new current item. More... | |
const_iterator | operator-- (int) |
Post-decrement operator makes the preceding item current and returns an iterator to the previously current item. More... | |
const_iterator & | operator-= (int i) |
Returns an iterator to the item at i positions backward from this iterator. More... | |
const_iterator & | operator= (const_iterator other) |
Assigns other to this . More... | |
bool | operator== (const const_iterator &other) const |
Returns true if other points to the same item as this iterator; otherwise returns false. More... | |
Detailed Description
The variant_associative_view::const_iterator allows iteration over an associative container in a variant.
An instance can only be created by an variant_associative_view.
Typical Usage
- Remarks
- The iterator is valid as long as the variant_associative_view and it corresponding variant is valid and not modified.
Member Typedef Documentation
◆ self_type
◆ value_type
Constructor & Destructor Documentation
◆ ~const_iterator()
rttr::variant_associative_view::const_iterator::~const_iterator | ( | ) |
Destroys the variant_associative_view::const_iterator.
◆ const_iterator()
rttr::variant_associative_view::const_iterator::const_iterator | ( | const const_iterator & | other | ) |
Creates a copy of other
.
Member Function Documentation
◆ get_key()
const variant rttr::variant_associative_view::const_iterator::get_key | ( | ) | const |
Returns the current key, stored inside a std::reference_wrapper<T>
and copied to a variant.
◆ get_value()
const variant rttr::variant_associative_view::const_iterator::get_value | ( | ) | const |
Returns the current value, stored inside a std::reference_wrapper<T>
and copied to a variant.
◆ operator *()
const std::pair<variant, variant> rttr::variant_associative_view::const_iterator::operator * | ( | ) | const |
Returns the underlying key and value stored in a std::pair<key, value>
.
The actual data in the variant is stored inside a std::reference_wrapper<T>
◆ operator!=()
bool rttr::variant_associative_view::const_iterator::operator!= | ( | const const_iterator & | other | ) | const |
Returns true if other
points to a different item than this iterator; otherwise returns false.
- See also
- operator==
◆ operator+()
const_iterator rttr::variant_associative_view::const_iterator::operator+ | ( | int | i | ) | const |
Returns an iterator to the item at i positions forward from this iterator.
◆ operator++() [1/2]
const_iterator& rttr::variant_associative_view::const_iterator::operator++ | ( | ) |
Pre-increment operator advances the iterator to the next item in the container and returns an iterator to the new current item.
- Remarks
- Calling this function on and iterator with value variant_associative_view::end() leads to undefined behaviour.
◆ operator++() [2/2]
const_iterator rttr::variant_associative_view::const_iterator::operator++ | ( | int | ) |
Post-increment operator advances the iterator to the next item in the container and returns an iterator to the previously current item.
◆ operator+=()
const_iterator& rttr::variant_associative_view::const_iterator::operator+= | ( | int | i | ) |
Advances the iterator by i items.
◆ operator-()
const_iterator rttr::variant_associative_view::const_iterator::operator- | ( | int | i | ) | const |
Returns an iterator to the item at i positions backward from this iterator.
◆ operator--() [1/2]
const_iterator& rttr::variant_associative_view::const_iterator::operator-- | ( | ) |
Pre-decrement operator makes the preceding item current and returns an iterator to the new current item.
- Remarks
- Calling this function on and iterator with value variant_associative_view::begin() leads to undefined behaviour.
◆ operator--() [2/2]
const_iterator rttr::variant_associative_view::const_iterator::operator-- | ( | int | ) |
Post-decrement operator makes the preceding item current and returns an iterator to the previously current item.
◆ operator-=()
const_iterator& rttr::variant_associative_view::const_iterator::operator-= | ( | int | i | ) |
Returns an iterator to the item at i positions backward from this iterator.
◆ operator=()
const_iterator& rttr::variant_associative_view::const_iterator::operator= | ( | const_iterator | other | ) |
Assigns other
to this
.
◆ operator==()
bool rttr::variant_associative_view::const_iterator::operator== | ( | const const_iterator & | other | ) | const |
Returns true
if other
points to the same item as this iterator; otherwise returns false.
- See also
- operator!=
The documentation for this class was generated from the following file:
Generated on Sat Apr 27 2019 03:11:25 for rttr - 0.9.6 by doxygen.