Commit 8bb0b503 by Dino Radakovic Committed by Copybara-Service

`overload_test`: Remove a few unnecessary trailing return types

`absl::StrCat` always returns a `std::string`. Specifying it using a trailing return type does not help.
Tests are documentation, and they should be consistent with [the google style guide](https://google.github.io/styleguide/cppguide.html#trailing_return).

For example, this is different than `-> absl::string_view` and returning string literals, where it is actually a load-bearing change.

PiperOrigin-RevId: 636705683
Change-Id: I0d84a562a59bc0c16be01dd2ae5538adb401432e
parent d60c089e
...@@ -32,12 +32,10 @@ namespace { ...@@ -32,12 +32,10 @@ namespace {
TEST(OverloadTest, DispatchConsidersTypeWithAutoFallback) { TEST(OverloadTest, DispatchConsidersTypeWithAutoFallback) {
auto overloaded = absl::Overload{ auto overloaded = absl::Overload{
[](int v) -> std::string { return absl::StrCat("int ", v); }, [](int v) { return absl::StrCat("int ", v); },
[](double v) -> std::string { return absl::StrCat("double ", v); }, [](double v) { return absl::StrCat("double ", v); },
[](const char* v) -> std::string { [](const char* v) { return absl::StrCat("const char* ", v); },
return absl::StrCat("const char* ", v); [](auto v) { return absl::StrCat("auto ", v); },
},
[](auto v) -> std::string { return absl::StrCat("auto ", v); },
}; };
EXPECT_EQ("int 1", overloaded(1)); EXPECT_EQ("int 1", overloaded(1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment