Lightning Talk: Help! My Expression Template Type Names Are Too Long! - Braden Ganetsky CppCon 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 เม.ย. 2024
  • cppcon.org/
    ---
    Lightning Talk: Help! My Expression Template Type Names Are Too Long! - Braden Ganetsky - CppCon 2023
    github.com/CppCon/CppCon2023
    Even the name of this talk is too long! If we're ever working with expression templates, we can easily make type names long enough to slow down compilation time. Suddenly our "zero-overhead" expression templates start giving a large compile time overhead. I'll show off a C++20 trick to fix this problem.
    ---
    Braden Ganetsky
    Braden Ganetsky graduated from the University of Manitoba with a degree in mechanical engineering, but soon pivoted to C++. Now he spends his days working on supply chain simulation software, and spends his nights working on parser combinators and getting involved in the C++ community.
    ---
    Videos Filmed & Edited by Bash Films: www.BashFilms.com
    TH-cam Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
    ---
    Registration for CppCon: cppcon.org/registration/
    #cppcon #cppprogramming #cpp
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @AnthonyDentinger
    @AnthonyDentinger 2 หลายเดือนก่อน +16

    This is so stupid. And I love it!

  • @314Labs
    @314Labs 2 หลายเดือนก่อน +16

    That parsing library is incredible I wanna use it rn

  • @guiorgy
    @guiorgy 2 หลายเดือนก่อน +3

    Interesting find

  • @sonulohani
    @sonulohani 2 หลายเดือนก่อน +1

    Nice video

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

    I'd love to know all the tricks about this, too.
    Crossplatform prefferered.

  • @__kyune__
    @__kyune__ 2 หลายเดือนก่อน

    Template type names are actually weird in C++. I just used std::map but when it hit an error, the compiler also showed me the default typename of that std::map and that took me a couple minutes to figure out what happended 😂

  • @AlfredoCorrea
    @AlfredoCorrea 2 หลายเดือนก่อน

    Doesn't mputz/mp-units use a trick with the same objective to keep the names of the type quantities short?

  • @electronpie
    @electronpie 2 หลายเดือนก่อน

    Isn't metaprogramming with concepts and variadic templates instead of SFINAE and traditional templating supposed to fix that issue or at least contribute to doing so?

  • @B14kh4r4z
    @B14kh4r4z 2 หลายเดือนก่อน

    Why not make a template Add{} and implement operator+ such that the whole sum will result in one Add instantiation? Do I miss a point here?

    • @sidasdf
      @sidasdf 2 หลายเดือนก่อน

      operator+ is a binary operation.

  • @brockdaniel8845
    @brockdaniel8845 2 หลายเดือนก่อน

    why only msvc tho ?🙄

    • @literallynull
      @literallynull 20 วันที่ผ่านมา

      that's how the MSVC mangling works. And mangling is the part of the ABI.
      GCC/Clang use industry standard Itanium ABI

  • @ABaumstumpf
    @ABaumstumpf 2 หลายเดือนก่อน +3

    But now the question: why make all that a giant pile of templates?

    • @aioia3885
      @aioia3885 2 หลายเดือนก่อน

      I'm not an expert but maybe the Wikipedia article for expression templates can explain that

    • @LyubomyrSemkiv
      @LyubomyrSemkiv 2 หลายเดือนก่อน

      Because we can 😅

    • @grisumbras
      @grisumbras 2 หลายเดือนก่อน

      Why make expression templates a bunch of templates? Good question.

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

      The parsing lib he showed in the beginning was a very good example of why this would happen. I have a similar case for a stream/pipeline library. I can also see this happen with composable allocators as described in andrej alexandrescu's talk about allocators from a couple of years ago.

    • @ichigonixsun
      @ichigonixsun 2 หลายเดือนก่อน

      Bacause C++ is a steaming pile of hot garbage

  • @Buy_YouTube_Views_a050
    @Buy_YouTube_Views_a050 2 หลายเดือนก่อน

    Thumbs up for joy!