const SBuf::size_type SBuf::npos;
const SBuf::size_type SBuf::maxSize;
-SBuf::SBuf()
- : store_(GetStorePrototype()), off_(0), len_(0)
+SBuf::SBuf() : store_(GetStorePrototype())
{
debugs(24, 8, id << " created");
++stats.alloc;
++stats.live;
}
-SBuf::SBuf(const std::string &s)
- : store_(GetStorePrototype()), off_(0), len_(0)
+SBuf::SBuf(const std::string &s) : store_(GetStorePrototype())
{
debugs(24, 8, id << " created from std::string");
lowAppend(s.data(),s.length());
++stats.live;
}
-SBuf::SBuf(const char *S, size_type n)
- : store_(GetStorePrototype()), off_(0), len_(0)
+SBuf::SBuf(const char *S, size_type n) : store_(GetStorePrototype())
{
append(S,n);
++stats.alloc;
++stats.live;
}
-SBuf::SBuf(const char *S)
- : store_(GetStorePrototype()), off_(0), len_(0)
+SBuf::SBuf(const char *S) : store_(GetStorePrototype())
{
append(S,npos);
++stats.alloc;
protected:
SBufIterator(const SBuf &, size_type);
- const char *iter;
+ const char *iter = nullptr;
};
/** Reverse input const_iterator for SBufs
/// create an empty (zero-size) SBuf
SBuf();
SBuf(const SBuf &S);
-#if __cplusplus >= 201103L
SBuf(SBuf&& S) : store_(std::move(S.store_)), off_(S.off_), len_(S.len_) {
++stats.moves;
- S.store_=NULL; //RefCount supports NULL, and S is about to be destructed
- S.off_=0;
- S.len_=0;
+ S.store_ = nullptr; //RefCount supports nullptr, and S is about to be destructed
+ S.off_ = S.len_ = 0;
}
-#endif
/** Constructor: import c-style string
*
friend class Locker;
MemBlob::Pointer store_; ///< memory block, possibly shared with other SBufs
- size_type off_; ///< our content start offset from the beginning of shared store_
- size_type len_; ///< number of our content bytes in shared store_
+ size_type off_ = 0; ///< our content start offset from the beginning of shared store_
+ size_type len_ = 0; ///< number of our content bytes in shared store_
static SBufStats stats; ///< class-wide statistics
/** obtain prototype store