Skip to content

Commit 45f91cb

Browse files
dinordcopybara-github
authored andcommitted
overload: Delete obsolete macros for undefining absl::Overload when C++ < 17
PiperOrigin-RevId: 726196763 Change-Id: Iccb643892f8b6ff4f6b456be0274e731f0dcd184
1 parent 7555944 commit 45f91cb

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

absl/functional/overload.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
// Before using this function, consider whether named function overloads would
2424
// be a better design.
2525
//
26-
// Note: absl::Overload requires C++17.
27-
//
2826
// Example:
2927
//
3028
// std::variant<std::string, int32_t, int64_t> v(int32_t{1});
@@ -46,9 +44,6 @@
4644
namespace absl {
4745
ABSL_NAMESPACE_BEGIN
4846

49-
#if defined(ABSL_INTERNAL_CPLUSPLUS_LANG) && \
50-
ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
51-
5247
template <typename... T>
5348
struct Overload final : T... {
5449
using T::operator()...;
@@ -71,21 +66,6 @@ struct Overload final : T... {
7166
template <typename... T>
7267
Overload(T...) -> Overload<T...>;
7368

74-
#else
75-
76-
namespace functional_internal {
77-
template <typename T>
78-
constexpr bool kDependentFalse = false;
79-
}
80-
81-
template <typename Dependent = int, typename... T>
82-
auto Overload(T&&...) {
83-
static_assert(functional_internal::kDependentFalse<Dependent>,
84-
"Overload is only usable with C++17 or above.");
85-
}
86-
87-
#endif
88-
8969
ABSL_NAMESPACE_END
9070
} // namespace absl
9171

absl/functional/overload_test.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@
1818
#include <string>
1919
#include <type_traits>
2020

21+
#include "gtest/gtest.h"
2122
#include "absl/base/config.h"
2223
#include "absl/strings/str_cat.h"
2324
#include "absl/strings/string_view.h"
2425
#include "absl/types/variant.h"
2526

26-
#if defined(ABSL_INTERNAL_CPLUSPLUS_LANG) && \
27-
ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
28-
29-
#include "gtest/gtest.h"
30-
3127
namespace {
3228

3329
TEST(OverloadTest, DispatchConsidersTypeWithAutoFallback) {
@@ -209,5 +205,3 @@ TEST(OverloadTest, HasConstexprConstructor) {
209205
}
210206

211207
} // namespace
212-
213-
#endif

0 commit comments

Comments
 (0)