From 1038c6f7f3824e7b836581991abdfb9c7ac0fd10 Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Sat, 3 Feb 2018 17:32:43 +0000 Subject: [PATCH] Don't call &* on PDUIterator --- include/tins/pdu_iterator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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->()) { }