From: Lucian Grijincu Date: Tue, 12 Aug 2014 01:14:21 +0000 (-0700) Subject: folly: operator << for MutableStringPiece X-Git-Tag: v0.22.0~410 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8925b6420691565261581f15a94203a188c1628b;p=folly.git folly: operator << for MutableStringPiece Test Plan: n.a Reviewed By: philipp@fb.com FB internal diff: D1487919 --- diff --git a/folly/Range.cpp b/folly/Range.cpp index 6bc09824..97d28b13 100644 --- a/folly/Range.cpp +++ b/folly/Range.cpp @@ -37,6 +37,11 @@ std::ostream& operator<<(std::ostream& os, const StringPiece& piece) { return os; } +std::ostream& operator<<(std::ostream& os, const MutableStringPiece& piece) { + os.write(piece.start(), piece.size()); + return os; +} + namespace detail { size_t qfind_first_byte_of_memchr(const StringPiece& haystack, diff --git a/folly/Range.h b/folly/Range.h index 4d7b1bcb..1f8c1782 100644 --- a/folly/Range.h +++ b/folly/Range.h @@ -804,6 +804,7 @@ typedef Range ByteRange; typedef Range MutableByteRange; std::ostream& operator<<(std::ostream& os, const StringPiece& piece); +std::ostream& operator<<(std::ostream& os, const MutableStringPiece& piece); /** * Templated comparison operators