From f4f91f421635276ba1eb4580c117edc38389e54b Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 1 Dec 2017 19:50:45 -0800 Subject: Changes imported from Abseil "staging" branch: - 1dde8a2a1868c32b32d62fba62eb37974f656948 Correct usage of CUnescape() in example. by Abseil Team GitOrigin-RevId: 1dde8a2a1868c32b32d62fba62eb37974f656948 Change-Id: I5183a74a3c682ac55b2bf4be0d871375e1302aae --- absl/strings/escaping.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/absl/strings/escaping.h b/absl/strings/escaping.h index 05327e7c..23444a98 100644 --- a/absl/strings/escaping.h +++ b/absl/strings/escaping.h @@ -64,7 +64,10 @@ namespace absl { // Example: // // std::string s = "foo\\rbar\\nbaz\\t"; -// std::string unescaped_s = absl::CUnescape(s); +// std::string unescaped_s; +// if (!absl::CUnescape(s, &unescaped_s) { +// ... +// } // EXPECT_EQ(unescaped_s, "foo\rbar\nbaz\t"); bool CUnescape(absl::string_view source, std::string* dest, std::string* error); -- cgit v1.2.3