Visual studio std::aligned_alloc()在visual studio 2019中缺失?c++;

Visual studio std::aligned_alloc()在visual studio 2019中缺失?c++;,visual-studio,c++17,Visual Studio,C++17,尽管我尝试分别启用std:c++latest和c++17,但我无法使用c++17中添加的std::aligned_alloc()函数。这是真实的生活吗?VisualStudio2019是否完全没有在标准中实现这样一个古老的功能(也是一个非常重要的功能)?其他人能证实吗 我所指的功能: 来自VC++2019的: C11-通用CRT实现了C++17所需的C11标准库的部分,但C99 strftime()E/O替代转换说明符、C11 fopen()独占模式、和C11 aligned_alloc()除外

尽管我尝试分别启用std:c++latest和c++17,但我无法使用c++17中添加的std::aligned_alloc()函数。这是真实的生活吗?VisualStudio2019是否完全没有在标准中实现这样一个古老的功能(也是一个非常重要的功能)?其他人能证实吗

我所指的功能:

来自VC++2019的:

C11-通用CRT实现了C++17所需的C11标准库的部分,但C99 strftime()E/O替代转换说明符、C11 fopen()独占模式、和C11 aligned_alloc()除外。后者不太可能实现,因为C11以一种与free()的Microsoft实现不兼容的方式指定了aligned_alloc():即free()必须能够处理高度对齐的分配


VC++具有特定于内存的编译器,与2的幂对齐,另请参见。

他们难道不能将c++17 alligned_alloc()绑定到_alligned_malloc()吗?为什么不符合标准?VisualStudioC++现在基本上是另一种编程语言。我真的需要创建一个定制的alligned_alloc()函数,在使用visual studio时绑定到_alligned_malloc(),在使用另一个编译器时绑定到其他东西(即std::aligned_alloc,但是现在可能没有人符合标准)?@MatiasChara std要求
aligned_alloc
返回的内存块与常规
realloc
free
相“兼容”。MSVC的
\u aligned_malloc
需要
\u aligned_realloc
\u aligned_free
。猜猜如果我想让我的代码可移植,我应该使用宏在使用std::aligned_alloc()和_aligned_malloc及其各自的免费和realloc版本之间切换(当然,我只是用宏创建自己的函数来绑定到这些宏)。对吗?对齐的malloc和系列是否只能在windows中使用?这些都是windows的一部分,这意味着只能在windows中使用。然而,问题不仅仅是添加一些宏包装器。在
std
中,您可以编写一个函数
char*double\u字符串(char*str){return realloc(str,2*strlen(str)+1)}
并调用相同的函数,无论
str
是从
malloc
获取的还是
aligned\u alloc
。使用MSVC,您需要单独的函数。