File tree Expand file tree Collapse file tree 2 files changed +1
-27
lines changed
Expand file tree Collapse file tree 2 files changed +1
-27
lines changed Original file line number Diff line number Diff line change 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});
4644namespace absl {
4745ABSL_NAMESPACE_BEGIN
4846
49- #if defined(ABSL_INTERNAL_CPLUSPLUS_LANG) && \
50- ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
51-
5247template <typename ... T>
5348struct Overload final : T... {
5449 using T::operator ()...;
@@ -71,21 +66,6 @@ struct Overload final : T... {
7166template <typename ... T>
7267Overload (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-
8969ABSL_NAMESPACE_END
9070} // namespace absl
9171
Original file line number Diff line number Diff line change 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-
3127namespace {
3228
3329TEST (OverloadTest, DispatchConsidersTypeWithAutoFallback) {
@@ -209,5 +205,3 @@ TEST(OverloadTest, HasConstexprConstructor) {
209205}
210206
211207} // namespace
212-
213- #endif
You can’t perform that action at this time.
0 commit comments