Beyond struct: Meta-programming a struct Replacement in C++20 - John Bandela - CppCon 2021

  Рет қаралды 18,709

CppCon

CppCon

Күн бұрын

Пікірлер: 18
@MaitreBart
@MaitreBart 2 жыл бұрын
It's very interesting on paper (i.e. in a code review). It's full of good ideas. Such code is relatively easy to use and to review. But I'm a pragmatic developer. And in the debugger, that's a whole other story. If the meta_struct is composed of 2 iterators to a deque and 1 bool, and a function returns such an object, finding the value of the bool member in gdb is challenging.
@JohnDlugosz
@JohnDlugosz 2 жыл бұрын
You know, the variable layout of the fields in a structure, as well as automatic AOS to SOA was a fundamental feature of the JOVIAL language. That was in 1958, making it, along with ALGOL itself, one of the first block-structured languages. This particular feature did not catch on and as far as I know was not part of any other major language on the ALGOL family tree.
@N....
@N.... 2 жыл бұрын
34:00 That is actually really cool, I guess since the caller does the matching it's as efficient at runtime as having three reference parameters right? EDIT: Actually I think this can be done with minimal compile overhead and regular structs if person_ref has a template constructor
@Ken-S
@Ken-S 2 жыл бұрын
This talk showed a need for dynamic declaration for a type. I think cpp have to consider support "compiler time struct / class" and a way to convert them to "type / template".
@petermuller608
@petermuller608 2 жыл бұрын
Great talk! However, the pointer highlighting is highly distracting due to low frame rate
@Solarbonite
@Solarbonite 2 жыл бұрын
It'd be kinda nice to add operator[] for get. I think it should be doable and could make it look more standard? Eg person.id vs person["id"]? Kinda like how lua tables allow . indexing and array indexing.
@VivekNa
@VivekNa 2 жыл бұрын
The field name is a template param. So you can't get that array syntax
@kamlot0
@kamlot0 2 жыл бұрын
I think it is impossible. For get to work you need to know the value of the string at compile time, therefore it has to be inside . person["id"] is equivalent to get("id", person). But it needs to be get(person).
@YariRu
@YariRu 2 жыл бұрын
this is crazy
@ratgr
@ratgr 2 жыл бұрын
He asked himself if he could do it never if he should, hahah, amazing metaprograming skill however I woudn't use it, because of compiletime
@budiardjo6610
@budiardjo6610 9 ай бұрын
i'm cry
@saeed6296
@saeed6296 2 жыл бұрын
I wish there is an explanation for this complicated and ugly syntax 😭
@dozerthecat
@dozerthecat 2 жыл бұрын
C++ gets more academic every update. It's sad. We use c++ for the performance. Stop trying to draw analogies to json parsing. You are killing the language.
@TheIgoorR
@TheIgoorR 2 жыл бұрын
If you know C++ good, you can boost your code performance! This is true reason
@nickwilson3499
@nickwilson3499 2 жыл бұрын
@@TheIgoorR All of c++'s features, yet it's still slower than plain C
@broken_abi6973
@broken_abi6973 2 жыл бұрын
@@nickwilson3499 no, it is not.
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 14 МЛН
СОБАКА И  ТРИ ТАБАЛАПКИ Ч.2 #shorts
00:33
INNA SERG
Рет қаралды 893 М.
FA24 CSCI Review Session - CS111 Cunyet Akinlar Midterm 1
2:08:48
Queens College Learning Commons
Рет қаралды 1,4 М.
CppCon 2014: Mike Acton "Data-Oriented Design and C++"
1:27:46
Faster, Easier, Simpler Vectors - David Stone - CppCon 2021
1:00:56
Compiler Q&A, September 2024
2:10:03
Jonathan Blow
Рет қаралды 29 М.
Branchless Programming in C++ - Fedor Pikus - CppCon 2021
1:03:57