Even though I did try enabling both std:c++latest and also c++17 separately, I couldnt use the std::aligned_alloc() function added in c++17. Is this real life? Did visual studio 2019 just flat out not implement an age old feature like this one in the standard(and a pretty important one too)? Can someone else confirm?
the feature I refer to:
https://en.cppreference.com/w/cpp/memory/c/aligned_alloc
From the Microsoft C++ language conformance table for VC++ 2019:
C11 - The Universal CRT implemented the parts of the C11 Standard Library that are required by C++17, with the exception of C99 strftime() E/O alternative conversion specifiers, C11 fopen() exclusive mode, and C11 aligned_alloc(). The latter is unlikely to be implemented, because C11 specified aligned_alloc() in a way that's incompatible with the Microsoft implementation of free(): namely, that free() must be able to handle highly aligned allocations.
VC++ has the compiler specific _aligned_malloc for memory aligned to power of 2 values, and see also What can I use instead of std::aligned_alloc in MS Visual Studio 2013? .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With