Lightning Talk: sizeof((std::variant( double, char[10])) - Olivia Wasalski - CppNorth 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 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
    ---
    TH-cam Videos Edited & Optimised by Digital Medium: events.digital-medium.co.uk
    #cppnorth #cpp #cppprogramming
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 3

  • @abhinavk0929
    @abhinavk0929 8 หลายเดือนก่อน +2

    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?

  • @neijiagongfu
    @neijiagongfu 8 หลายเดือนก่อน

    So basically std::aligned_storage/-_union which was deprecated in C++23.

  • @szaszm_
    @szaszm_ 8 หลายเดือนก่อน +2

    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.