From a09b5de0d57d7b2179210989ab63361c3c1894f5 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 24 Mar 2021 18:51:51 -0700 Subject: Export of internal Abseil changes -- 3de7250f2988e360764479fa590d299a649987c0 by Derek Mauro : Make the SOVERSION fit into 16 bits to make the MacOS linker happy PiperOrigin-RevId: 364939757 -- dead27aa0734a89ccb25da807e08e61000a47f8f by Abseil Team : Update `ABSL_ATTRIBUTE_UNUSED`'s documentation that `[[maybe_unused]]` in C++17 and up is now the preferred usage solution. Also document why we can't update `ABSL_ATTRIBUTE_UNUSED` to use `[[maybe_unused]]` (differences in positioning requirements). PiperOrigin-RevId: 364900016 -- 0baf1b01dc9a2b5f9869ff5a52a1cf7a032055a3 by Abseil Team : Slightly weaken the spec for `absl::string_view::compare` to match C++17. The Abseil-specific implementation provides a stronger guarantee than required by `std::string_view`, returning +1, 0, or -1. When `absl::string_view` is an alias for `std::string_view`, these are only guaranteed to be positive, zero, and negative. Portable code should not depend on the stronger guarantee. PiperOrigin-RevId: 364846419 GitOrigin-RevId: 3de7250f2988e360764479fa590d299a649987c0 Change-Id: I7c74004fc38c9f5eaad5b104a993b79518497c5b --- absl/strings/string_view.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'absl/strings/string_view.h') diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h index 5260b5b7..b276bdba 100644 --- a/absl/strings/string_view.h +++ b/absl/strings/string_view.h @@ -398,12 +398,10 @@ class string_view { // string_view::compare() // - // Performs a lexicographical comparison between the `string_view` and - // another `absl::string_view`, returning -1 if `this` is less than, 0 if - // `this` is equal to, and 1 if `this` is greater than the passed string - // view. Note that in the case of data equality, a further comparison is made - // on the respective sizes of the two `string_view`s to determine which is - // smaller, equal, or greater. + // Performs a lexicographical comparison between this `string_view` and + // another `string_view` `x`, returning a negative value if `*this` is less + // than `x`, 0 if `*this` is equal to `x`, and a positive value if `*this` + // is greater than `x`. constexpr int compare(string_view x) const noexcept { return CompareImpl(length_, x.length_, Min(length_, x.length_) == 0 -- cgit v1.2.3