19 #include <initializer_list> 21 #include <type_traits> 127 namespace replaceable_detail {
160 T* destruct_ptr =
launder(reinterpret_cast<T*>(
167 template <
class T,
bool A>
202 std::is_nothrow_constructible<
T>::
value) {
225 std::is_nothrow_constructible<
T>::
value) {
284 std::is_nothrow_move_constructible<
T>::
value) {
285 T* destruct_ptr =
launder(reinterpret_cast<T*>(
349 T* destruct_ptr =
launder(reinterpret_cast<T*>(
358 template <
typename T>
361 std::is_constructible<T, Replaceable<T>&>::value ||
362 std::is_constructible<T, Replaceable<T>&&>::value ||
363 std::is_constructible<T, const Replaceable<T>&>::value ||
364 std::is_constructible<T, const Replaceable<T>&&>::value> {};
366 template <
typename T>
369 std::is_convertible<Replaceable<T>&, T>::value ||
370 std::is_convertible<Replaceable<T>&&, T>::value ||
371 std::is_convertible<const Replaceable<T>&, T>::value ||
372 std::is_convertible<const Replaceable<T>&&, T>::value> {};
389 template <
class T,
class...
Args>
394 template <
class T,
class U,
class...
Args>
396 std::initializer_list<U> il,
402 class alignas(T) Replaceable
416 constexpr Replaceable() =
default;
417 constexpr Replaceable(
const Replaceable&) =
default;
418 constexpr Replaceable(Replaceable&&) =
default;
427 Replaceable& operator=(
const Replaceable&) =
default;
428 Replaceable& operator=(Replaceable&&) =
default;
433 ~Replaceable() =
default;
441 std::enable_if_t<std::is_constructible<
T,
Args&&...>
::value,
int> = 0>
447 ::new (storage_)
T(std::forward<Args>(args)...);
454 std::is_constructible<T, std::initializer_list<U>,
Args&&...>
::value,
458 std::initializer_list<U> il,
463 std::initializer_list<U>,
467 ::new (storage_)
T(il, std::forward<Args>(args)...);
475 !std::is_same<Replaceable<T>, std::decay_t<U>>
::value &&
483 ::new (storage_)
T(std::forward<U>(other));
491 !std::is_same<Replaceable<T>, std::decay_t<U>>
::value &&
492 !std::is_convertible<U&&, T>::value,
499 ::new (storage_)
T(std::forward<U>(other));
516 ::new (storage_)
T(*other);
526 !std::is_convertible<const U&, T>::value,
533 ::new (storage_)
T(*other);
543 std::is_convertible<U&&, T>::value,
560 !std::is_convertible<U&&, T>::value,
582 template <
class...
Args>
584 T* destruct_ptr =
launder(reinterpret_cast<T*>(storage_));
586 return *::new (storage_)
T(std::forward<Args>(args)...);
589 template <
class U,
class...
Args>
591 T* destruct_ptr =
launder(reinterpret_cast<T*>(storage_));
593 return *::new (storage_)
T(il, std::forward<Args>(args)...);
602 void swap(Replaceable& other) {
604 swap(*(*
this), *other);
611 return launder(reinterpret_cast<T const*>(storage_));
615 return launder(reinterpret_cast<T*>(storage_));
619 return *
launder(reinterpret_cast<T const*>(storage_));
623 return *
launder(reinterpret_cast<T*>(storage_));
640 std::aligned_storage_t<sizeof(T), alignof(T)> storage_[1];
643 #if __cplusplus > 201402L 646 Replaceable(T)->Replaceable<T>;
copy_assignment_mixin & operator=(copy_assignment_mixin const &other) noexcept(std::is_nothrow_destructible< T >::value &&std::is_nothrow_copy_constructible< T >::value)
FOLLY_CPP14_CONSTEXPR Replaceable(in_place_t, std::initializer_list< U > il, Args &&...args) noexcept(std::is_nothrow_constructible< T, std::initializer_list< U >, Args &&... >::value)
FOLLY_CPP14_CONSTEXPR T & operator*()&
default_and_move_ctor_mixin() noexcept(std::is_nothrow_constructible< T >::value)
#define FOLLY_CPP14_CONSTEXPR
constexpr const T & operator*() const &
constexpr detail::Map< Move > move
FOLLY_CPP14_CONSTEXPR Replaceable(U &&other) noexcept(std::is_nothrow_constructible< T, U && >::value)
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
—— Concurrent Priority Queue Implementation ——
in_place_tag in_place(in_place_tag={})
requires E e noexcept(noexcept(s.error(std::move(e))))
in_place_tag(&)(in_place_tag) in_place_t
~dtor_mixin() noexcept(std::is_nothrow_destructible< T >::value)
bool_constant< true > true_type
Replaceable(Replaceable< U > &&other) noexcept(std::is_nothrow_constructible< T, U && >::value)
T & emplace(Args &&...args) noexcept
FOLLY_CPP14_CONSTEXPR T * operator->()
std::integral_constant< bool, B > bool_constant
move_assignment_mixin & operator=(move_assignment_mixin &&other) noexcept(std::is_nothrow_destructible< T >::value &&std::is_nothrow_move_constructible< T >::value)
void swap(Replaceable &other)
default_and_move_ctor_mixin() noexcept(std::is_nothrow_constructible< T >::value)
static const char *const value
default_and_move_ctor_mixin(int)
T & emplace(std::initializer_list< U > il, Args &&...args) noexcept
Replaceable(const Replaceable< U > &other) noexcept(std::is_nothrow_constructible< T, U const & >::value)
void swap(exception_wrapper &a, exception_wrapper &b) noexcept
constexpr Replaceable< std::decay_t< T > > make_replaceable(T &&t)
default_and_move_ctor_mixin(int)
default_and_move_ctor_mixin(default_and_move_ctor_mixin &&other) noexcept(std::is_nothrow_constructible< T, T && >::value)
default_and_move_ctor_mixin(int)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
bool_constant< false > false_type
default_and_move_ctor_mixin(default_and_move_ctor_mixin &&other) noexcept(std::is_nothrow_constructible< T, T && >::value)
FOLLY_NODISCARD T * launder(T *in) noexcept
default_and_move_ctor_mixin(int)
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
constexpr const T * operator->() const
constexpr const T && operator*() const &&
FOLLY_CPP14_CONSTEXPR Replaceable(in_place_t, Args &&...args) noexcept(std::is_nothrow_constructible< T, Args &&... >::value)
copy_ctor_mixin(copy_ctor_mixin const &other) noexcept(std::is_nothrow_constructible< T, T const & >::value)
FOLLY_CPP14_CONSTEXPR T && operator*()&&