mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-04 01:06:19 +08:00
Use std::launder where appropriate (#181)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user