From 8925b6420691565261581f15a94203a188c1628b Mon Sep 17 00:00:00 2001 From: Lucian Grijincu Date: Mon, 11 Aug 2014 18:14:21 -0700 Subject: [PATCH] folly: operator << for MutableStringPiece Test Plan: n.a Reviewed By: philipp@fb.com FB internal diff: D1487919 --- folly/Range.cpp | 5 +++++ folly/Range.h | 1 + 2 files changed, 6 insertions(+) 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 -- 2.34.1