diff --git a/include/fast_io_core_impl/io_lockable.h b/include/fast_io_core_impl/io_lockable.h index 890556c21..0d0ef5258 100644 --- a/include/fast_io_core_impl/io_lockable.h +++ b/include/fast_io_core_impl/io_lockable.h @@ -49,8 +49,7 @@ struct basic_general_io_lockable_nonmovable } else { - ::std::destroy_at(__builtin_addressof(handle)); - ::std::construct_at(__builtin_addressof(handle), ::std::forward(args)...); + this->handle = T(::std::forward(args)...); } } constexpr void close() noexcept(noexcept(handle.close())) diff --git a/include/fast_io_hosted/threads/mutex/impl.h b/include/fast_io_hosted/threads/mutex/impl.h index 2cda3081c..a5b332623 100644 --- a/include/fast_io_hosted/threads/mutex/impl.h +++ b/include/fast_io_hosted/threads/mutex/impl.h @@ -37,7 +37,8 @@ using native_mutex = ; template -using basic_mutex_movable = ::fast_io::basic_general_mutex_movable; +using basic_mutex_movable = ::std::conditional_t<::std::movable, Mutex, + ::fast_io::basic_general_mutex_movable>; using native_mutex_movable = ::fast_io::basic_mutex_movable; template