Use launder to access buffer SSO storage

This commit is contained in:
2025-03-18 23:42:30 +01:00
parent 4884b59433
commit 7023c0cc9a
2 changed files with 2 additions and 4 deletions

View File

@ -403,7 +403,7 @@ public:
return buffer.is_on_heap()
? return_type{ buffer.m_data }
// NOLINTNEXTLINE(*-reinterpret-cast)
: reinterpret_cast<return_type>(&buffer);
: std::launder(reinterpret_cast<return_type>(&buffer));
}
}

View File

@ -1,3 +1 @@
review unions
review reinterpret_cast
review as_bytes & static_cast in general