Commit 8e1f0fc3 authored by Alessio Bonfiglio's avatar Alessio Bonfiglio Committed by Nate Graham
Browse files

Make AggregateSensor::SensorIterator satisfy LegacyInputIterator

parent 052249c3
Pipeline #228137 passed with stage
in 2 minutes and 43 seconds
......@@ -87,6 +87,13 @@ AggregateSensor::SensorIterator &AggregateSensor::SensorIterator::operator++()
return *this;
}
AggregateSensor::SensorIterator AggregateSensor::SensorIterator::operator++(int)
{
AggregateSensor::SensorIterator tmp = *this;
operator++();
return tmp;
}
bool AggregateSensor::SensorIterator::operator==(const SensorIterator &other) const
{
return m_it == other.m_it;
......
......@@ -7,6 +7,7 @@
#pragma once
#include <functional>
#include <iterator>
#include <memory>
#include <QPointer>
......@@ -44,12 +45,23 @@ public:
class SensorIterator
{
public:
using iterator_category = std::input_iterator_tag;
using value_type = QVariant;
using difference_type = SensorHash::size_type;
using pointer = void;
using reference = QVariant &;
SensorIterator(const SensorIterator &) = default;
SensorIterator &operator=(const SensorIterator &) = default;
~SensorIterator() = default;
SensorIterator(SensorHash::const_iterator begin, const SensorHash::const_iterator end)
: m_it(begin)
, m_end(end){};
QVariant operator*() const;
value_type operator*() const;
SensorIterator &operator++();
SensorIterator operator++(int);
bool operator==(const SensorIterator &other) const;
bool operator!=(const SensorIterator &other) const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment