From: Nick Terrell Date: Mon, 29 Aug 2016 16:50:36 +0000 (-0700) Subject: Add default constructor to folly::IOBuf::Iterator. X-Git-Tag: v2016.09.05.00~21 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b90a2ba56027995d17ed3a1d37f895e42ad255cd;p=folly.git 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 --- 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_; };