From 082c006c04343a78d87b6c6ab3608c25d6213c3f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Nov 2020 14:43:54 +0100 Subject: merge(3p/absl): subtree merge of Abseil up to e19260f ... notably, this includes Abseil's own StatusOr type, which conflicted with our implementation (that was taken from TensorFlow). Change-Id: Ie7d6764b64055caaeb8dc7b6b9d066291e6b538f --- third_party/abseil_cpp/absl/meta/BUILD.bazel | 2 +- third_party/abseil_cpp/absl/meta/type_traits.h | 28 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'third_party/abseil_cpp/absl/meta') diff --git a/third_party/abseil_cpp/absl/meta/BUILD.bazel b/third_party/abseil_cpp/absl/meta/BUILD.bazel index c06d2d9708c1..5585fcca794a 100644 --- a/third_party/abseil_cpp/absl/meta/BUILD.bazel +++ b/third_party/abseil_cpp/absl/meta/BUILD.bazel @@ -24,7 +24,7 @@ load( package(default_visibility = ["//visibility:public"]) -licenses(["notice"]) # Apache 2.0 +licenses(["notice"]) cc_library( name = "type_traits", diff --git a/third_party/abseil_cpp/absl/meta/type_traits.h b/third_party/abseil_cpp/absl/meta/type_traits.h index ba87d2f0edfa..d5cb5f3be39d 100644 --- a/third_party/abseil_cpp/absl/meta/type_traits.h +++ b/third_party/abseil_cpp/absl/meta/type_traits.h @@ -219,7 +219,7 @@ using void_t = typename type_traits_internal::VoidTImpl::type; // This metafunction is designed to be a drop-in replacement for the C++17 // `std::conjunction` metafunction. template -struct conjunction; +struct conjunction : std::true_type {}; template struct conjunction @@ -228,9 +228,6 @@ struct conjunction template struct conjunction : T {}; -template <> -struct conjunction<> : std::true_type {}; - // disjunction // // Performs a compile-time logical OR operation on the passed types (which @@ -241,7 +238,7 @@ struct conjunction<> : std::true_type {}; // This metafunction is designed to be a drop-in replacement for the C++17 // `std::disjunction` metafunction. template -struct disjunction; +struct disjunction : std::false_type {}; template struct disjunction : @@ -250,9 +247,6 @@ struct disjunction : template struct disjunction : T {}; -template <> -struct disjunction<> : std::false_type {}; - // negation // // Performs a compile-time logical NOT operation on the passed type (which @@ -616,8 +610,22 @@ using common_type_t = typename std::common_type::type; template using underlying_type_t = typename std::underlying_type::type; -template -using result_of_t = typename std::result_of::type; + +namespace type_traits_internal { + +#if __cplusplus >= 201703L +// std::result_of is deprecated (C++17) or removed (C++20) +template struct result_of; +template +struct result_of : std::invoke_result {}; +#else +template using result_of = std::result_of; +#endif + +} // namespace type_traits_internal + +template +using result_of_t = typename type_traits_internal::result_of::type; namespace type_traits_internal { // In MSVC we can't probe std::hash or stdext::hash because it triggers a -- cgit 1.4.1