Add default constructor to folly::IOBuf::Iterator.
authorNick Terrell <terrelln@fb.com>
Mon, 29 Aug 2016 16:50:36 +0000 (09:50 -0700)
committerFacebook Github Bot 0 <facebook-github-bot-0-bot@fb.com>
Mon, 29 Aug 2016 16:54:01 +0000 (09:54 -0700)
Summary:
Iterators must be default constructible.
folly::IOBuf can now be used as a range in ranges-v3.

Reviewed By: yfeldblum

Differential Revision: D3782536

fbshipit-source-id: 854813b4e3336aba50048649e6ae7b375d49e382

folly/io/IOBuf.h

index 1727b6e46bcb516054a39a04a4a4cc573932eba6..98e7d744b0ea4d73ba34bf3c30c00e2dc98c4b11 100644 (file)
@@ -1480,6 +1480,8 @@ class IOBuf::Iterator : public boost::iterator_facade<
     }
   }
 
+  Iterator() {}
+
  private:
   void setVal() {
     val_ = ByteRange(pos_->data(), pos_->tail());
@@ -1510,8 +1512,8 @@ class IOBuf::Iterator : public boost::iterator_facade<
     adjustForEnd();
   }
 
-  const IOBuf* pos_;
-  const IOBuf* end_;
+  const IOBuf* pos_{nullptr};
+  const IOBuf* end_{nullptr};
   ByteRange val_;
 };