Does std::allocator handle over-aligned types in C++17?

北城以北 提交于 2019-12-04 08:11:38

In N4659(C++17 DIS), 23.10.9.1 [allocator.members], bullet 2

T* allocate(size_t n);

Returns: A pointer to the initial element of an array of storage of size n * sizeof(T), aligned appropriately for objects of type T.

Compared to C++14, the sentence

It is implementation-defined whether over-aligned types are supported

has been removed. So std::allocator should support over-aligned types in C++17.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!