diff options
Diffstat (limited to 'absl')
-rw-r--r-- | absl/LTS.md | 13 | ||||
-rw-r--r-- | absl/types/internal/variant.h | 45 | ||||
-rw-r--r-- | absl/types/variant.h | 6 |
3 files changed, 22 insertions, 42 deletions
diff --git a/absl/LTS.md b/absl/LTS.md deleted file mode 100644 index f7be0997c429..000000000000 --- a/absl/LTS.md +++ /dev/null @@ -1,13 +0,0 @@ -# Long Term Support (LTS) Branches - -This repository contains periodic snapshots of the Abseil codebase that are -Long Term Support (LTS) branches. An LTS branch allows you to use a known -version of Abseil without interfering with other projects which may also, in -turn, use Abseil. (For more information about our releases, see the -[Abseil Release Management](https://abseil.io/about/releases) guide. - -## LTS Branches - -The following lists LTS branches and the date they have been released: - -* [LTS Branch June 18, 2018](https://github.com/abseil/abseil-cpp/tree/lts_2018_06_18/) diff --git a/absl/types/internal/variant.h b/absl/types/internal/variant.h index 94c2ddab6fcb..3414c9142daf 100644 --- a/absl/types/internal/variant.h +++ b/absl/types/internal/variant.h @@ -1100,49 +1100,40 @@ using EqualResult = decltype(std::declval<T>() == std::declval<T>()); template <class T> using NotEqualResult = decltype(std::declval<T>() != std::declval<T>()); -template <class T> -using HasLessThan = is_detected_convertible<bool, LessThanResult, T>; - -template <class T> -using HasGreaterThan = is_detected_convertible<bool, GreaterThanResult, T>; - -template <class T> -using HasLessThanOrEqual = - is_detected_convertible<bool, LessThanOrEqualResult, T>; - -template <class T> -using HasGreaterThanOrEqual = - is_detected_convertible<bool, GreaterThanOrEqualResult, T>; - -template <class T> -using HasEqual = is_detected_convertible<bool, EqualResult, T>; - -template <class T> -using HasNotEqual = is_detected_convertible<bool, NotEqualResult, T>; - template <class... T> -using RequireAllHaveEqualT = - absl::enable_if_t<absl::conjunction<HasEqual<T>...>::value, bool>; +using RequireAllHaveEqualT = absl::enable_if_t< + absl::conjunction<is_detected_convertible<bool, EqualResult, T>...>::value, + bool>; template <class... T> using RequireAllHaveNotEqualT = - absl::enable_if_t<absl::conjunction<HasEqual<T>...>::value, bool>; + absl::enable_if_t<absl::conjunction<is_detected_convertible< + bool, NotEqualResult, T>...>::value, + bool>; template <class... T> using RequireAllHaveLessThanT = - absl::enable_if_t<absl::conjunction<HasLessThan<T>...>::value, bool>; + absl::enable_if_t<absl::conjunction<is_detected_convertible< + bool, LessThanResult, T>...>::value, + bool>; template <class... T> using RequireAllHaveLessThanOrEqualT = - absl::enable_if_t<absl::conjunction<HasLessThan<T>...>::value, bool>; + absl::enable_if_t<absl::conjunction<is_detected_convertible< + bool, LessThanOrEqualResult, T>...>::value, + bool>; template <class... T> using RequireAllHaveGreaterThanOrEqualT = - absl::enable_if_t<absl::conjunction<HasLessThan<T>...>::value, bool>; + absl::enable_if_t<absl::conjunction<is_detected_convertible< + bool, GreaterThanOrEqualResult, T>...>::value, + bool>; template <class... T> using RequireAllHaveGreaterThanT = - absl::enable_if_t<absl::conjunction<HasLessThan<T>...>::value, bool>; + absl::enable_if_t<absl::conjunction<is_detected_convertible< + bool, GreaterThanResult, T>...>::value, + bool>; // Helper template containing implementations details of variant that can't go // in the private section. For convenience, this takes the variant type as a diff --git a/absl/types/variant.h b/absl/types/variant.h index 5837a1be2105..55017ae194b0 100644 --- a/absl/types/variant.h +++ b/absl/types/variant.h @@ -445,9 +445,11 @@ constexpr bool operator!=(monostate, monostate) noexcept { return false; } //------------------------------------------------------------------------------ template <typename T0, typename... Tn> class variant<T0, Tn...> : private variant_internal::VariantBase<T0, Tn...> { + // Intentionally not qualifing `negation` with `absl::` to work around a bug + // in MSVC 2015 with inline namespace and variadic template. static_assert(absl::conjunction<std::is_object<T0>, std::is_object<Tn>..., - absl::negation<std::is_array<T0>>, - absl::negation<std::is_array<Tn>>..., + negation<std::is_array<T0> >, + negation<std::is_array<Tn> >..., std::is_nothrow_destructible<T0>, std::is_nothrow_destructible<Tn>...>::value, "Attempted to instantiate a variant with an unsupported type."); |