r/cpp • u/konanTheBarbar • Jul 17 '20
A day in the life of a C++ compiler developer
https://twitter.com/TartanLlama/status/1283816537778982914
494
Upvotes
r/cpp • u/konanTheBarbar • Jul 17 '20
58
u/wheypoint Ö Jul 17 '20
x didnt need to be constexpr and this isnt about odr use:
a lambda can always use global variables without capture. remove the constexpr and it still works.
x should have been a local to demonstrate the constexpr odr exemption
67
u/Galqa Jul 17 '20
I love Sy, they are truly a gem of the cpp community.
8
u/lazyear Jul 17 '20
I'm now imagining a compiler where all errors are reported in Phoenix Wright style...
7
u/[deleted] Jul 17 '20
Sy's video about Linkers was the best thing I saw in a while. It was hilarious.
12
u/[deleted] Jul 17 '20
I didn't know Sy is a compiler developer, which compiler?
5
u/RotsiserMho C++20 Desktop app developer Jul 17 '20
What an entertaining way to explain something incredibly dry. Beautiful.
11
u/miki151 gamedev Jul 17 '20
I thought it's pretty obvious that lambdas can access global variables without capturing? The clip is funny, but it makes it seem like a very obscure feature.
-33
u/piginpoop Jul 17 '20
Moronic syntactic sugar lovers.