Created on 2014-03-30.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N3936.
Edit [ptr.align] p2 as indicated:
void* align(std::size_t alignment, std::size_t size, void*& ptr, std::size_t& space);-1- […]
-2- Requires:
alignment shall be a
fundamental alignment value or an extended alignment value supported by the implementation in this contextpower of two
[ 2014-06-16 Rapperswil ]
Move to Ready
std::align requires that its alignment argument shall be "a fundamental alignment value or an extended alignment value supported by the implementation in this context".
This requirement is overly strict. There are use cases that require a buffer aligned at values that are not tied to the C++ implementation, such as page size, cache line size, sector size. These come from the hardware or the OS and are generally not known until run time. The implementation of std::align does not depend on the requirement that alignment be a fundamental or an extended alignment value; any power of two would be handled the same way. In addition, it is not possible for the user to even determine whether a value is "a fundamental alignment value or an extended alignment value supported by the implementation in this context". One would expect values coming from alignof to be fine, but I'm not sure whether even that is guaranteed in the presence of alignas. Therefore, I propose thatRequires:
alignment shall be a fundamental alignment value or an extended alignment value supported by the implementation in this context
be changed to
Requires:
alignment shall be a power of two
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2014-11-08 19:44:42 | admin | set | status: voting -> wp |
2014-11-04 10:26:50 | admin | set | status: ready -> voting |
2014-06-16 23:38:27 | admin | set | messages: + msg7050 |
2014-06-16 23:38:27 | admin | set | status: new -> ready |
2014-03-31 19:39:38 | admin | set | messages: + msg6933 |
2014-03-30 00:00:00 | admin | create |