X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FReplaceable.h;h=92d1ec6f6bc3d6402642bbc718dc833467c9a00a;hb=7acba7e1a0a75d22087647b3e9e830c9b0e8d41e;hp=011b1f8b9582261a0c8586a6173c90209130f3a8;hpb=ea815395588bf55ce57f505e05f5df469edf3436;p=folly.git diff --git a/folly/Replaceable.h b/folly/Replaceable.h index 011b1f8b..92d1ec6f 100644 --- a/folly/Replaceable.h +++ b/folly/Replaceable.h @@ -21,9 +21,10 @@ #include #include -#include +#include #include #include +#include /** * An instance of `Replaceable` wraps an instance of `T`. @@ -450,7 +451,7 @@ class alignas(T) Replaceable template < class... Args, std::enable_if_t::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::value) // clang-format on @@ -464,7 +465,7 @@ class alignas(T) Replaceable std::enable_if_t< std::is_constructible, Args&&...>::value, int> = 0> - constexpr explicit Replaceable( + FOLLY_CPP14_CONSTEXPR explicit Replaceable( in_place_t, std::initializer_list il, Args&&... args) @@ -486,7 +487,7 @@ class alignas(T) Replaceable !std::is_same, std::decay_t>::value && std::is_convertible::value, int> = 0> - constexpr /* implicit */ Replaceable(U&& other) + FOLLY_CPP14_CONSTEXPR /* implicit */ Replaceable(U&& other) // clang-format off noexcept(std::is_nothrow_constructible::value) // clang-format on @@ -502,7 +503,7 @@ class alignas(T) Replaceable !std::is_same, std::decay_t>::value && !std::is_convertible::value, int> = 0> - explicit constexpr Replaceable(U&& other) + FOLLY_CPP14_CONSTEXPR explicit Replaceable(U&& other) // clang-format off noexcept(std::is_nothrow_constructible::value) // clang-format on @@ -622,7 +623,7 @@ class alignas(T) Replaceable return launder(reinterpret_cast(storage_)); } - constexpr T* operator->() { + FOLLY_CPP14_CONSTEXPR T* operator->() { return launder(reinterpret_cast(storage_)); } @@ -630,11 +631,11 @@ class alignas(T) Replaceable return *launder(reinterpret_cast(storage_)); } - constexpr T& operator*() & { + FOLLY_CPP14_CONSTEXPR T& operator*() & { return *launder(reinterpret_cast(storage_)); } - constexpr T&& operator*() && { + FOLLY_CPP14_CONSTEXPR T&& operator*() && { return std::move(*launder(reinterpret_cast(storage_))); }