Remove template helper constants
authorPhil Willoughby <philwill@fb.com>
Mon, 31 Jul 2017 08:35:58 +0000 (01:35 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 31 Jul 2017 08:36:52 +0000 (01:36 -0700)
Summary: Not supported by some environments.

Reviewed By: yfeldblum

Differential Revision: D5526180

fbshipit-source-id: 2c2b6f7627860c5f896532b90601c817530e6b69

folly/Replaceable.h

index bdd5519e098d87cb2cb57142651082fc749ff08a..011b1f8b9582261a0c8586a6173c90209130f3a8 100644 (file)
@@ -357,10 +357,6 @@ struct is_constructible_from_replaceable
               std::is_constructible<T, const Replaceable<T>&>::value ||
               std::is_constructible<T, const Replaceable<T>&&>::value> {};
 
-template <typename T>
-constexpr bool is_constructible_from_replaceable_v{
-    is_constructible_from_replaceable<T>::value};
-
 template <typename T>
 struct is_convertible_from_replaceable
     : std::integral_constant<
@@ -369,10 +365,6 @@ struct is_convertible_from_replaceable
               std::is_convertible<Replaceable<T>&&, T>::value ||
               std::is_convertible<const Replaceable<T>&, T>::value ||
               std::is_convertible<const Replaceable<T>&&, T>::value> {};
-
-template <typename T>
-constexpr bool is_convertible_from_replaceable_v{
-    is_convertible_from_replaceable<T>::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 <class T>
 struct is_replaceable<Replaceable<T>> : std::true_type {};
 
-template <class T>
-constexpr bool is_replaceable_v{is_replaceable<T>::value};
-
 // Function to make a Replaceable with a type deduced from its input
 template <class T>
 constexpr Replaceable<std::decay_t<T>> make_replaceable(T&& t) {
@@ -525,8 +514,9 @@ class alignas(T) Replaceable
       class U,
       std::enable_if_t<
           std::is_constructible<T, const U&>::value &&
-              !replaceable_detail::is_constructible_from_replaceable_v<T> &&
-              !replaceable_detail::is_convertible_from_replaceable_v<T> &&
+              !replaceable_detail::is_constructible_from_replaceable<
+                  T>::value &&
+              !replaceable_detail::is_convertible_from_replaceable<T>::value &&
               std::is_convertible<const U&, T>::value,
           int> = 0>
   /* implicit */ Replaceable(const Replaceable<U>& other)
@@ -541,8 +531,9 @@ class alignas(T) Replaceable
       class U,
       std::enable_if_t<
           std::is_constructible<T, const U&>::value &&
-              !replaceable_detail::is_constructible_from_replaceable_v<T> &&
-              !replaceable_detail::is_convertible_from_replaceable_v<T> &&
+              !replaceable_detail::is_constructible_from_replaceable<
+                  T>::value &&
+              !replaceable_detail::is_convertible_from_replaceable<T>::value &&
               !std::is_convertible<const U&, T>::value,
           int> = 0>
   explicit Replaceable(const Replaceable<U>& other)
@@ -557,8 +548,9 @@ class alignas(T) Replaceable
       class U,
       std::enable_if_t<
           std::is_constructible<T, U&&>::value &&
-              !replaceable_detail::is_constructible_from_replaceable_v<T> &&
-              !replaceable_detail::is_convertible_from_replaceable_v<T> &&
+              !replaceable_detail::is_constructible_from_replaceable<
+                  T>::value &&
+              !replaceable_detail::is_convertible_from_replaceable<T>::value &&
               std::is_convertible<U&&, T>::value,
           int> = 0>
   /* implicit */ Replaceable(Replaceable<U>&& other)
@@ -573,8 +565,9 @@ class alignas(T) Replaceable
       class U,
       std::enable_if_t<
           std::is_constructible<T, U&&>::value &&
-              !replaceable_detail::is_constructible_from_replaceable_v<T> &&
-              !replaceable_detail::is_convertible_from_replaceable_v<T> &&
+              !replaceable_detail::is_constructible_from_replaceable<
+                  T>::value &&
+              !replaceable_detail::is_convertible_from_replaceable<T>::value &&
               !std::is_convertible<U&&, T>::value,
           int> = 0>
   explicit Replaceable(Replaceable<U>&& other)