]> granicus.if.org Git - taglib/commitdiff
added comments explaining ByteVector::rbegin() const and ByteVector::rend() const
authorRyan Lucchese <ryan.lucchese@write-c.com>
Mon, 6 Jul 2015 22:25:57 +0000 (16:25 -0600)
committerRyan Lucchese <ryan.lucchese@write-c.com>
Mon, 6 Jul 2015 22:25:57 +0000 (16:25 -0600)
taglib/toolkit/tbytevector.cpp

index fb561e25f384c1491492eee427aca2c7c860fb5a..7840d1a281393337c7cf3e1687b0ffe9ca4ac983 100644 (file)
@@ -746,6 +746,7 @@ ByteVector::ReverseIterator ByteVector::rbegin()
 
 ByteVector::ConstReverseIterator ByteVector::rbegin() const
 {
+  // we need a const reference to the data vector so we can ensure the const version of rbegin() is called
   const std::vector<char> &v = d->data->data;
   return v.rbegin() + (v.size() - (d->offset + d->length));
 }
@@ -758,6 +759,7 @@ ByteVector::ReverseIterator ByteVector::rend()
 
 ByteVector::ConstReverseIterator ByteVector::rend() const
 {
+  // we need a const reference to the data vector so we can ensure the const version of rbegin() is called
   const std::vector<char> &v = d->data->data;
   return v.rbegin() + (v.size() - d->offset);
 }