TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24659 26
What I Learned About [no_unique_address] and Padding Reuse in C++

https://nekrozqliphort.github.io/posts/no-unique-address/

Hey everyone! It’s been a while since my last write-up. I recently spent some time looking into [[no_unique_address]], specifically whether it reliably saves space by reusing padding bytes. In a few cases, it didn’t behave quite as I expected, so I decided to dig a bit deeper.

This post is a short investigation into when padding reuse does and doesn't happen, with some concrete layout examples and ABI-level discussion.

Any feedback or corrections would be greatly appreciated!

https://redd.it/1q95vk1
@r_cpp
Ryan Chung Learner’s Notes: Alignment and padding - What does [[no_unique_address]] do? Problem Statement Let’s start with a small, innocent-looking example: ```cpp struct Foo { long long foo_val; bool foo_val2; };
More from @r_cpp
  1. Oct 8, 2026Profiles for simplicity and guarantees - Bjarne Stroustrup - CppCon 2026 https://youtu.be/…
  2. Oct 8, 2026How to Fix autoconf-style Configuration Probing https://build2.org/blog/fix-autoconf.xhtml…
  3. Oct 8, 2026owl – a header-only C++23 HTTP framework where route patterns and handler extractors are c…
  4. Oct 8, 2026Removed by Reddit Removed by Reddit on account of violating the [content policy. ] https:/…
  5. Oct 8, 2026Is there a way to search across all P and N papers throughout standardization history? It…
  6. Oct 8, 2026CppCast Episode 412 : Safety and Interoperability with Rust and C++ https://cppcast.com/sa…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →