diff --git a/include/tins/hw_address.h b/include/tins/hw_address.h index 9252490..d385f00 100644 --- a/include/tins/hw_address.h +++ b/include/tins/hw_address.h @@ -222,7 +222,7 @@ public: * \return bool indicating whether addresses are equal. */ bool operator==(const HWAddress &rhs) const { - return std::equal(begin(), end(), rhs.begin()); + return std::equal(begin(), end(), rhs.buffer); } /** @@ -325,13 +325,16 @@ public: * But since some PDUs return a HWAddress<> by value, this function * can be used to avoid temporaries. * - * \param iter The output iterator in which to store this address. + * \param output The output iterator in which to store this address. * \return OutputIterator pointing to one-past the last position * written. */ template - OutputIterator copy(OutputIterator iter) const { - return std::copy(begin(), end(), iter); + OutputIterator copy(OutputIterator output) const { + for (const_iterator iter = begin(); iter != end(); ++iter) { + *output++ = *iter; + } + return output; } private: template diff --git a/include/tins/ipv6_address.h b/include/tins/ipv6_address.h index 2bff9a2..3b72b6f 100644 --- a/include/tins/ipv6_address.h +++ b/include/tins/ipv6_address.h @@ -137,7 +137,7 @@ public: * \return bool indicating whether addresses are equal. */ bool operator==(const IPv6Address &rhs) const { - return std::equal(begin(), end(), rhs.begin()); + return std::equal(begin(), end(), rhs.address); } /** diff --git a/include/tins/pdu_option.h b/include/tins/pdu_option.h index 3453964..752da27 100644 --- a/include/tins/pdu_option.h +++ b/include/tins/pdu_option.h @@ -502,11 +502,12 @@ private: } else { payload_.big_buffer_ptr = new data_type[real_size_]; - std::copy( - start, - end, - payload_.big_buffer_ptr - ); + uint8_t* ptr = payload_.big_buffer_ptr; + while (start < end) { + *ptr = *start; + ++ptr; + ++start; + } } }