Closed WopsS closed 1 year ago
Thank you for the report! I'll patch it as soon as I find some time
Fixed in 686d36af8a614db5e74fc88bcc21e3f72e80e862 on master, thank you!
Thanks! The issue is that right now it doesn't compile :(
Maybe just char[size]
would be enough here (https://github.com/gracicot/kangaru/commit/686d36af8a614db5e74fc88bcc21e3f72e80e862). If alignas
is really necessary than something like should work:
template<std::size_t size, std::size_t align>
struct aligned_storage_t
{
alignas(align) char data[size];
};
Yeah I saw the pipeline failing on non gcc compiler, seems like I used an extension without knowing. I'll probably just put alignas(align) unsigned char data[size];
at the places I used aligned_storage_t
in the past and removing that alias.
(alignment is actually important or there will be undefined behaviour, x86 just enable broken code to work in some common case)
It should be okay now, I can see the master branch passing on all runners
Thank you for the fix! :D
Describe the bug When a project utilizes this library and is compiled with C++23, a deprecation warning is issued by the compiler. This warning is associated with the use of
std::aligned_storage<Len, Align>
, which is deprecated in C++23. The deprecation warning message is as follows:The warning is triggered by the following line of code: https://github.com/gracicot/kangaru/blob/36f70dba250f070c7abf844af1c0aefb55640907/include/kangaru/detail/traits.hpp#L58
To Reproduce
Expected behavior
The expected behavior is for the project to compile without any deprecation warnings, without the need to suppress them.
Desktop (please complete the following information):
Additional context
A potential solution could be to create a struct using alignas. However, if a project enables the /W4 flag, it will yield Compiler Warning (level 4) C4324. An alternative workaround may involve using #pragma warning(suppress : 4324), but this seems like a less-than-ideal, somewhat hacky solution.
Is alignment necessary for this library? If not, the code could be refactored to eliminate the need for alignment.