The unintuitive part: Why can't the simple case of 3:45 just work by having the data in static memory / data segment? Is there a hard rule that vector needs to point to the heap? surely not! Basically, the compiler could to the "2 step" and copy from compile-time memory to static memory
Due to an issue with slide sync, this video will be rereleased: th-cam.com/video/_AefJX66io8/w-d-xo.html
Pretty clever tricks. Seems like the slides video is a little ahead of the live camera though, which was slightly confusing at first.
16:10 [slide 6.3] I believe in C++26 we’ll have this container, named inplace_vector (paper P0843 was voted to the standard)
42:57 [slide 15.2] I’d use distance(input) instead of size(input)
16:03 better names would be array_half_full or array_half_empty depending on if you work at an optimist or pessimist place
Lots of screen space lost to #includes, kinda surprised Jason of all people didn't just put import std; there
The unintuitive part:
Why can't the simple case of 3:45 just work by having the data in static memory / data segment?
Is there a hard rule that vector needs to point to the heap? surely not!
Basically, the compiler could to the "2 step" and copy from compile-time memory to static memory
is there a version where the slides aren't out of sync?
Yes, they just uploaded it
I don't get why it is safe to return a view from a local array when in a constexpr context. Can someone explain?
It is not safe in general only when the local array is static. Then it's lifetime exceeds the caller.
nice