From b90a2ba56027995d17ed3a1d37f895e42ad255cd Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Mon, 29 Aug 2016 09:50:36 -0700 Subject: [PATCH] Add default constructor to folly::IOBuf::Iterator. 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/folly/io/IOBuf.h b/folly/io/IOBuf.h index 1727b6e4..98e7d744 100644 --- a/folly/io/IOBuf.h +++ b/folly/io/IOBuf.h @@ -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_; }; -- 2.34.1