diff --git a/include/tins/pdu_iterator.h b/include/tins/pdu_iterator.h index c91bab2..2b185c1 100644 --- a/include/tins/pdu_iterator.h +++ b/include/tins/pdu_iterator.h @@ -106,8 +106,8 @@ private: */ template bool operator==(const PDUIteratorBase& lhs, const PDUIteratorBase& rhs) { - const PDU* lhs_pdu = &*static_cast(lhs); - const PDU* rhs_pdu = &*static_cast(rhs); + const PDU* lhs_pdu = static_cast(lhs).operator->(); + const PDU* rhs_pdu = static_cast(rhs).operator->(); return lhs_pdu == rhs_pdu; } @@ -241,7 +241,7 @@ public: template PDUIteratorRange(const PDUIteratorRange& other) - : start_(&*other.begin()), end_(&*other.end()) { + : start_(other.begin().operator->()), end_(other.end().operator->()) { }