40#include <seastar/util/modules.hh>
44SEASTAR_MODULE_EXPORT_BEGIN
46template <
typename T,
typename Alloc>
49transfer_pass1(Alloc& a, T* from, T* to,
50 std::enable_if_t<std::is_nothrow_move_constructible_v<T>>* =
nullptr) {
51 std::allocator_traits<Alloc>::construct(a, to, std::move(*from));
52 std::allocator_traits<Alloc>::destroy(a, from);
55template <
typename T,
typename Alloc>
58transfer_pass2(Alloc&, T*, T*,
59 std::enable_if_t<std::is_nothrow_move_constructible_v<T>>* =
nullptr) {
62template <
typename T,
typename Alloc>
65transfer_pass1(Alloc& a, T* from, T* to,
66 std::enable_if_t<!std::is_nothrow_move_constructible_v<T>>* =
nullptr) {
67 std::allocator_traits<Alloc>::construct(a, to, *from);
70template <
typename T,
typename Alloc>
73transfer_pass2(Alloc& a, T* from, T*,
74 std::enable_if_t<!std::is_nothrow_move_constructible_v<T>>* =
nullptr) {
75 std::allocator_traits<Alloc>::destroy(a, from);
77SEASTAR_MODULE_EXPORT_END
Seastar API namespace.
Definition: abort_on_ebadf.hh:26