folly::fibers::Baton API consistency with folly::Baton
[folly.git] / folly / Replaceable.h
index 011b1f8b9582261a0c8586a6173c90209130f3a8..92d1ec6f6bc3d6402642bbc718dc833467c9a00a 100644 (file)
 #include <type_traits>
 #include <utility>
 
-#include <folly/Launder.h>
+#include <folly/Portability.h>
 #include <folly/Traits.h>
 #include <folly/Utility.h>
+#include <folly/lang/Launder.h>
 
 /**
  * An instance of `Replaceable<T>` wraps an instance of `T`.
@@ -450,7 +451,7 @@ class alignas(T) Replaceable
   template <
       class... Args,
       std::enable_if_t<std::is_constructible<T, Args&&...>::value, int> = 0>
-  constexpr explicit Replaceable(in_place_t, Args&&... args)
+  FOLLY_CPP14_CONSTEXPR explicit Replaceable(in_place_t, Args&&... args)
       // clang-format off
       noexcept(std::is_nothrow_constructible<T, Args&&...>::value)
       // clang-format on
@@ -464,7 +465,7 @@ class alignas(T) Replaceable
       std::enable_if_t<
           std::is_constructible<T, std::initializer_list<U>, Args&&...>::value,
           int> = 0>
-  constexpr explicit Replaceable(
+  FOLLY_CPP14_CONSTEXPR explicit Replaceable(
       in_place_t,
       std::initializer_list<U> il,
       Args&&... args)
@@ -486,7 +487,7 @@ class alignas(T) Replaceable
               !std::is_same<Replaceable<T>, std::decay_t<U>>::value &&
               std::is_convertible<U&&, T>::value,
           int> = 0>
-  constexpr /* implicit */ Replaceable(U&& other)
+  FOLLY_CPP14_CONSTEXPR /* implicit */ Replaceable(U&& other)
       // clang-format off
       noexcept(std::is_nothrow_constructible<T, U&&>::value)
       // clang-format on
@@ -502,7 +503,7 @@ class alignas(T) Replaceable
               !std::is_same<Replaceable<T>, std::decay_t<U>>::value &&
               !std::is_convertible<U&&, T>::value,
           int> = 0>
-  explicit constexpr Replaceable(U&& other)
+  FOLLY_CPP14_CONSTEXPR explicit Replaceable(U&& other)
       // clang-format off
       noexcept(std::is_nothrow_constructible<T, U&&>::value)
       // clang-format on
@@ -622,7 +623,7 @@ class alignas(T) Replaceable
     return launder(reinterpret_cast<T const*>(storage_));
   }
 
-  constexpr T* operator->() {
+  FOLLY_CPP14_CONSTEXPR T* operator->() {
     return launder(reinterpret_cast<T*>(storage_));
   }
 
@@ -630,11 +631,11 @@ class alignas(T) Replaceable
     return *launder(reinterpret_cast<T const*>(storage_));
   }
 
-  constexpr T& operator*() & {
+  FOLLY_CPP14_CONSTEXPR T& operator*() & {
     return *launder(reinterpret_cast<T*>(storage_));
   }
 
-  constexpr T&& operator*() && {
+  FOLLY_CPP14_CONSTEXPR T&& operator*() && {
     return std::move(*launder(reinterpret_cast<T*>(storage_)));
   }