# Template Class iterator_impl

- Defined in File node.hpp

## Class Documentation

template<typename T>
class iterator_impl

  generic iterator class.

  We can have iterators that point to nodes, elements and attributes. Iterating over nodes is simply following next/prev. But iterating elements is a bit more difficult, since you then have to skip nodes in between that are not an element, like comments or text.

  This iterator is used for iterators over elements, attributes and simply all nodes

  Public Types

  using iterator_category = std::bidirectional_iterator_tag
  using value_type = T
  using pointer = value_type*
  using reference = value_type&
  using difference_type = std::ptrdiff_t

  Public Functions

  iterator_impl() = default
  inline iterator_impl(node *current)
  inline iterator_impl(const node *current)
  iterator_impl(const iterator_impl &i) = default
  template<typename Iterator>
  inline iterator_impl(const Iterator &i)

    Copy constructor.

    This copy constructor allows to copy from the same value_type and from derived types. That means that you can assign an iterator pointing to an element to a new iterator pointing to nodes. But vice versa is not possible.

  inline iterator_impl &operator=(iterator_impl i)
  template<typename Iterator>
  inline iterator_impl &operator=(const Iterator &i)
  inline reference operator*() const
  inline pointer operator->() const
  inline iterator_impl &operator++()
  inline iterator_impl operator++(int)
  inline iterator_impl &operator--()
  inline iterator_impl operator--(int)
  template<typename IteratorType>
  inline bool operator==(const IteratorType &other) const
  inline bool operator==(const iterator_impl &other) const
  template<NodeType T2>
  inline bool operator==(const T2 *n) const
  inline explicit operator pointer() const