Lightning Talk: sizeof((std::variant( double, char[10])) - Olivia Wasalski - CppNorth 2023
Vložit
- čas přidán 13. 10. 2023
- www.cppnorth.ca
---
Lightning Talk: What is the sizeof Function? - Olivia Wasalski - CppNorth 2023
What is the sizeof(std::variant double, char[10]), can it be optimized, and why does it matter?
---
Slides: github.com/CppNorth/CppNorth_...
Sponsored By:
think-cell: www.think-cell.com/cppnorth
JetBrains: www.jetbrains.com/
---
Olivia Wasalski
Olivia Wasalski is a C++ developer at Safe Software Inc. She primarily works on computational geometry algorithms but enjoys packing bits in her spare time.
---
CppNorth is an annual C++ conference held in Toronto, Canada.
- Annual CppNorth C++ conference: cppnorth.ca/
- CppNorth Twitter: / cppnorth
---
CZcams Videos Edited & Optimised by Digital Medium: events.digital-medium.co.uk
#cppnorth #cpp #cppprogramming - Věda a technologie
Even if we use the variant as presented in the talk, the type in last example would still have a size of 16, no? is there something i'm missing here?
So basically std::aligned_storage/-_union which was deprecated in C++23.
I bet we wouldn't have this problem if the committee didn't reject the first variant proposal, a language-based `enum union` with pattern matching.