Summary:
adding what seems to be a missing constructor to StringPiece --
I need to be able to take a piece of another StringPiece. (It's possible
to do that with all sorts of strings already, except StringPiece...)
Test Plan: na -- tested as part of other (dependent) diffs
Reviewed By: delong.j@fb.com
FB internal diff:
D508545
b_ = str.data() + startFrom;
e_ = b_ + size;
}
+ Range(const Range<Iter>& str,
+ size_t startFrom,
+ size_t size) {
+ CHECK_LE(startFrom + size, str.size());
+ b_ = str.b_ + startFrom;
+ e_ = b_ + size;
+ }
// Works only for Range<const char*>
/* implicit */ Range(const fbstring& str)
: b_(str.data()), e_(b_ + str.size()) { }