Use std::launder where appropriate (#181)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2024-09-05 20:18:46 +02:00
committed by GitHub
parent b661b6147a
commit 7274a2eb47
7 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ struct Parser<R, W, std::array<T, _size>, ProcessorsType> {
[&](const InputArrayType& _arr) -> Result<std::array<T, _size>> {
alignas(
std::array<T, _size>) unsigned char buf[sizeof(std::array<T, _size>)];
auto ptr = reinterpret_cast<std::array<T, _size>*>(buf);
auto ptr = std::launder(reinterpret_cast<std::array<T, _size>*>(buf));
const auto array_reader =
ArrayReader<R, W, ProcessorsType, T, _size>(&_r, ptr);
auto err = _r.read_array(array_reader, _arr);