C++ Template Metaprogramming Madness [Reflective Serialization]

  Рет қаралды 1,118

ChiliTomatoNoodle

ChiliTomatoNoodle

Күн бұрын

Пікірлер: 17
@arthurprediger4054
@arthurprediger4054 5 күн бұрын
Oh, I missed this series last year :0. Went through it now and I love the Chili way of showing first the nonscalable way of solving the problem and then the better one. I definitely saw the build up for the better way coming up, but the actual solution was a big mistery until the last minute >
@solipsist644
@solipsist644 26 күн бұрын
Happy new Year! Currently in the midst of your Intermediate C++ series (and having a great time), but already taking a look at what the future of the C++ journey holds. Thank you for the incredibly well-crafted tutorial series and hope you'll continue putting out new content! Though your health and family (and especially the newest addition ;)) should be the priority.
@ChiliTomatoNoodle
@ChiliTomatoNoodle 26 күн бұрын
@@solipsist644 thanks for the kind words! There will always be new content :)
@PedroOliveira-sl6nw
@PedroOliveira-sl6nw 27 күн бұрын
And that is why I say that "C++ Templates" (the book) is the black magic book. Maybe it should be named "Templates of the Dark Arts"
@ChiliTomatoNoodle
@ChiliTomatoNoodle 27 күн бұрын
One day imma finish reading that one.
@goobensteen
@goobensteen 27 күн бұрын
Another christmas miracle!
@ChiliTomatoNoodle
@ChiliTomatoNoodle 27 күн бұрын
Hallelujah 🎄
@DotcomL
@DotcomL 27 күн бұрын
Reflection solved the main issue which was forgetting about a member of the struct. Cereal supports NVP and it would be trivial to extend to it using reflection. For the template metaprogramming hacks, hmm I think I'd have gone the way of checking whether all my types are serializable with some static assert on the variant, and still manually add support for each one (add one line of the macro) to fix when it fails to compile. And here it would simply use the cereal method to check if it's serializable. Less hacky IMHO, and don't forget you will still need to add cereal includes if you serialize other "native" types. But there's a magic to getting it all done automatically as you did! Happy new year and thanks for this awesome channel.
@ChiliTomatoNoodle
@ChiliTomatoNoodle 27 күн бұрын
I like the namespace detection approach, but you can't deny that UB, however unlikely to actually blow up, leaves a bad taste in the mouth. Thanks for watching and happy new year to you as well!
@SonicFan535
@SonicFan535 27 күн бұрын
Did you try using std::is_aggregate_v instead of std::is_class_v? Then there'd be much fewer types to exclude (if any). Also, maybe you could avoid the UB of injecting a function into std by checking for "move" or some other function that's already guaranteed to be in std (and hopefully nowhere else, since I can't think of a situation where you'd name your own single-argument function "move").
@ChiliTomatoNoodle
@ChiliTomatoNoodle 27 күн бұрын
is_aggregate is interesting. Would still need fixing up for stuff like std::pair. Using a pre-existing std function for the ADL is too risky though. E.g. for your example of "move", consider boost::move. Actually thinking about it, you could inject a template specialization (which is not UB) for something like std::hash, and use that for your ADL if you wanted to be 100% correct.
@aswinaswin5672
@aswinaswin5672 27 күн бұрын
Hey happy christmas and new year. I have some doubts. Iam very very new to your channel. Where should i start learning from your channel. I mean like which playlist should i start. Iam a beginner.
@ChiliTomatoNoodle
@ChiliTomatoNoodle 26 күн бұрын
@@aswinaswin5672 beginner c++ playlist. Check wiki.planetchili.net
@aswinaswin5672
@aswinaswin5672 26 күн бұрын
@@ChiliTomatoNoodle Thanks
@PedroOliveira-sl6nw
@PedroOliveira-sl6nw 27 күн бұрын
Wishing you a great 2025!
@ChiliTomatoNoodle
@ChiliTomatoNoodle 27 күн бұрын
Right back at you!
C++ std::variant Multi-Command Polymorphism [Reflective Serialization]
23:09
C++ Has Reflection Now??? [Reflective Serialization]
12:59
ChiliTomatoNoodle
Рет қаралды 1,2 М.
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 165 М.
Catching up with async Rust
17:55
fasterthanlime
Рет қаралды 30 М.
Inside the V3 Nazi Super Gun
19:52
Blue Paw Print
Рет қаралды 2,7 МЛН
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 218 М.
Two MIT Professors ACCIDENTALLY discovered this simple SECRET TO LEARNING
5:10
why do header files even exist?
10:53
Low Level
Рет қаралды 453 М.
Boost.Asio 5 [C++20 Coroutine]
22:45
ChiliTomatoNoodle
Рет қаралды 872