From ea815395588bf55ce57f505e05f5df469edf3436 Mon Sep 17 00:00:00 2001 From: Phil Willoughby Date: Mon, 31 Jul 2017 01:35:58 -0700 Subject: [PATCH] Remove template helper constants Summary: Not supported by some environments. Reviewed By: yfeldblum Differential Revision: D5526180 fbshipit-source-id: 2c2b6f7627860c5f896532b90601c817530e6b69 --- folly/Replaceable.h | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/folly/Replaceable.h b/folly/Replaceable.h index bdd5519e..011b1f8b 100644 --- a/folly/Replaceable.h +++ b/folly/Replaceable.h @@ -357,10 +357,6 @@ struct is_constructible_from_replaceable std::is_constructible&>::value || std::is_constructible&&>::value> {}; -template -constexpr bool is_constructible_from_replaceable_v{ - is_constructible_from_replaceable::value}; - template struct is_convertible_from_replaceable : std::integral_constant< @@ -369,10 +365,6 @@ struct is_convertible_from_replaceable std::is_convertible&&, T>::value || std::is_convertible&, T>::value || std::is_convertible&&, T>::value> {}; - -template -constexpr bool is_convertible_from_replaceable_v{ - is_convertible_from_replaceable::value}; } // namespace replaceable_detail // Type trait template to statically test whether a type is a specialization of @@ -383,9 +375,6 @@ struct is_replaceable : std::false_type {}; template struct is_replaceable> : std::true_type {}; -template -constexpr bool is_replaceable_v{is_replaceable::value}; - // Function to make a Replaceable with a type deduced from its input template constexpr Replaceable> make_replaceable(T&& t) { @@ -525,8 +514,9 @@ class alignas(T) Replaceable class U, std::enable_if_t< std::is_constructible::value && - !replaceable_detail::is_constructible_from_replaceable_v && - !replaceable_detail::is_convertible_from_replaceable_v && + !replaceable_detail::is_constructible_from_replaceable< + T>::value && + !replaceable_detail::is_convertible_from_replaceable::value && std::is_convertible::value, int> = 0> /* implicit */ Replaceable(const Replaceable& other) @@ -541,8 +531,9 @@ class alignas(T) Replaceable class U, std::enable_if_t< std::is_constructible::value && - !replaceable_detail::is_constructible_from_replaceable_v && - !replaceable_detail::is_convertible_from_replaceable_v && + !replaceable_detail::is_constructible_from_replaceable< + T>::value && + !replaceable_detail::is_convertible_from_replaceable::value && !std::is_convertible::value, int> = 0> explicit Replaceable(const Replaceable& other) @@ -557,8 +548,9 @@ class alignas(T) Replaceable class U, std::enable_if_t< std::is_constructible::value && - !replaceable_detail::is_constructible_from_replaceable_v && - !replaceable_detail::is_convertible_from_replaceable_v && + !replaceable_detail::is_constructible_from_replaceable< + T>::value && + !replaceable_detail::is_convertible_from_replaceable::value && std::is_convertible::value, int> = 0> /* implicit */ Replaceable(Replaceable&& other) @@ -573,8 +565,9 @@ class alignas(T) Replaceable class U, std::enable_if_t< std::is_constructible::value && - !replaceable_detail::is_constructible_from_replaceable_v && - !replaceable_detail::is_convertible_from_replaceable_v && + !replaceable_detail::is_constructible_from_replaceable< + T>::value && + !replaceable_detail::is_convertible_from_replaceable::value && !std::is_convertible::value, int> = 0> explicit Replaceable(Replaceable&& other) -- 2.34.1