mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
Workaround for a regression introduced ~MSVC 15.8.1
This commit is contained in:
parent
7cf7314486
commit
818b7a7314
@ -54,10 +54,17 @@ constexpr std::size_t max_element_of(std::initializer_list<std::size_t> list) {
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// Workarround for a regression introduced in ~ MSVC 15.8.1
|
||||
template <typename T>
|
||||
using size_of_helper = std::integral_constant<std::size_t, sizeof(T)>;
|
||||
template <typename T>
|
||||
using align_of_helper = std::integral_constant<std::size_t, alignof(T)>;
|
||||
|
||||
template <typename... T>
|
||||
constexpr auto storage_of_impl(traits::identity<T...>) {
|
||||
constexpr auto size = max_element_of({sizeof(T)...});
|
||||
constexpr auto align = max_element_of({alignof(T)...});
|
||||
constexpr auto size = max_element_of({(size_of_helper<T>::value)...});
|
||||
constexpr auto align = max_element_of({(align_of_helper<T>::value)...});
|
||||
return std::aligned_storage_t<size, align>{};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user