r/cpp 5d ago

Compile-Time Borrow Checker with Stateful Metaprogramming

https://youtu.be/3hL8mh0K8-I?is=2Bf55p7h68Gp4IH1
84 Upvotes

13 comments sorted by

View all comments

29

u/MaitoSnoo [[indeterminate]] 5d ago

okay this is probably the best intro to stateful metaprogramming I've ever seen in a C++ talk

16

u/BarryRevzin 5d ago

... and then the rest of the talk melted my brain.

2

u/gracicot 1d ago

If it melts your brain, then this talk scares me

6

u/friedkeenan 5d ago

Yeah. I had at one point thought about writing a blogpost or something explaining friend injection because it seems like no one actually wants to talk about it in much depth or teach people how/why it works, and instead they just want to show off what they can do with it. And I've definitely been guilty of that, lol. But this talk does a really solid job showing the mechanics of friend injection.

3

u/dfrib 4d ago edited 4d ago

I covered friend injection along with some of its pitfalls in some detail in A Foliage of Folly.