boostorg / fiber

userland threads
464 stars 108 forks source link

avoid deprecated std::aligned_storage #312

Closed Hailios closed 11 months ago

Hailios commented 11 months ago

this is in response to the deprecation warning noted in the mailing list.

I think this patch will get rid of the warning, and also give smaller objects on some compilers. see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61458 for details of std::aligned_storage size.

" [build] /usr/include/boost/fiber/future/detail/shared_state.hpp:160:19: warning: 'aligned_storage<4, 4>' is deprecated [-Wdeprecated-declarations] [build] 160 | typename std::alignedstorage< sizeof( R), alignof( R) >::type storage{}; [build] | ^ [build] /usr/include/boost/fiber/future/promise.hpp:28:22: note: in instantiation of template class 'boost::fibers::detail::shared_state' requested here [build] 28 | typedef typename shared_state< R >::ptr_type ptr_type; "

olk commented 11 months ago

ty