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
@@ -33,7 +33,7 @@ struct TupleParser {
const InputVarType& _var) noexcept {
const auto parse = [&](const InputArrayType& _arr) -> Result<TupleType> {
alignas(TupleType) unsigned char buf[sizeof(TupleType)];
auto ptr = reinterpret_cast<TupleType*>(buf);
auto ptr = std::launder(reinterpret_cast<TupleType*>(buf));
const auto tuple_reader =
TupleReader<R, W, TupleType, _ignore_empty_containers, _all_required,
ProcessorsType>(&_r, ptr);