Date: Sun, 29 Jun 2025 12:06:02 +0200
[ptr.align] specifies that `std::assume_aligned` throws *nothing*, so why
isn't it already marked as `noexcept`?
Current signature:
`template [[nodiscard]] constexpr T* assume_aligned(T* ptr);`
Proposed signature:
`template [[nodiscard]] constexpr T* assume_aligned(T* ptr) noexcept;`
Impact on the standard: none
Implementation: add noexcept specifier
Reason: Better codegen on some compilers with exceptions (because of
noexcept), after all this function is meant to be an optimisation point.
Another smaller reason to use this function is noexcept functions, because
some static analysers are not happy with using not noexcept functions in
noexcept context...
Tymi.
isn't it already marked as `noexcept`?
Current signature:
`template [[nodiscard]] constexpr T* assume_aligned(T* ptr);`
Proposed signature:
`template [[nodiscard]] constexpr T* assume_aligned(T* ptr) noexcept;`
Impact on the standard: none
Implementation: add noexcept specifier
Reason: Better codegen on some compilers with exceptions (because of
noexcept), after all this function is meant to be an optimisation point.
Another smaller reason to use this function is noexcept functions, because
some static analysers are not happy with using not noexcept functions in
noexcept context...
Tymi.
Received on 2025-06-29 10:06:14