Core C++ 2019 :: Dan Saks :: Understanding Lvalues and Rvalues

  Рет қаралды 12,693

CoreCppIL

CoreCppIL

Күн бұрын

Пікірлер: 15
@anthonyrocha8075
@anthonyrocha8075 3 жыл бұрын
This is the best explanation of this topic I've seen so far.
@JGunlimited
@JGunlimited 5 жыл бұрын
Perfect! Was stumbling on this topic, great to have an in-depth look.
@JohnDlugosz
@JohnDlugosz 5 жыл бұрын
I was expecting something for more advanced programmers -- all the newer stuff about prvalue, xvalue, etc. and guaranteed copy elision. I think his material predates C++11, and he added some annotations like "now use nullptr" in a _comment_ where the slide has NULL. In (literally, the last 5 minutes (56:40)) he has an appendix to his legacy lesson, saying "C++11 changes things." and speeds through slides on lvalue references and the diagram of all the --value categories, but that appears at 59:23 and he spends a full 90 seconds on it.
@jvsnyc
@jvsnyc 3 жыл бұрын
I don't know if you worked it all out since then, or just kind of forgot about it for a while. If the latter, I think this talk is fantastic: kzbin.info/www/bejne/oZ6WhqWlnMSqsM0 It's his only talk that I've seen on KZbin, but is terrific. Dan Saks works in the embedded world, and bounces back and forth between C and C++ a lot. There are other tells in the presentation. Who would ever use a non-Class enum in C++ but someone who also uses C almost every day? I think he would have talked some more about the modern twists and turns if his audience didn't keep asking questions, we lost a good five minutes of the end of the talk here. The talk I linked to is great, if you search, there is an alternate version of it with a slightly different scope of coverage.
@jvsnyc
@jvsnyc 3 жыл бұрын
Also, from the same year, his son (I think) did this lecture, which while not quite the tour-de-force that the other one I linked to was, was also great and went into a few things a little more deeply maybe: kzbin.info/www/bejne/joSVe5eahdZqfbM
@yuwuxiong1165
@yuwuxiong1165 4 жыл бұрын
good intro. i guess one of the other reasons behind the introduction of "reference" is because we want to let compiler to watch out for us not to miss use pointers when it's initialized once and never change.
@bonbonpony
@bonbonpony 4 жыл бұрын
Nope, the real reason was what he talked about somewhere around 41:21 - operator overloading. Everything else might be considered a bonus. But without introducing references, overloaded operators couldn't work the same way as the built-in operators work. Long story short, if you want operator overloading to work as expected, you gotta introduce references.
@VishalSharma-ys9wt
@VishalSharma-ys9wt 5 жыл бұрын
Really nice introduction!
@tijshoeijmakers3514
@tijshoeijmakers3514 4 жыл бұрын
Great talk, but very annoying crowd...
@0x656e
@0x656e 4 жыл бұрын
Such an amazing talk.
@agnesakne4409
@agnesakne4409 Жыл бұрын
this man is good
@abdelrhmanahmed1378
@abdelrhmanahmed1378 4 жыл бұрын
int x = 6; int z = 10; int& p =x; p = 100; cout
@bonbonpony
@bonbonpony 4 жыл бұрын
First tell us why do you expect `z` to contain 200? You never change `z` after you initialized it to 10. After you strip all that fuss you put around it, the `z` part of your program boils down to: int z = 10; cout
@ryanpxl
@ryanpxl 4 жыл бұрын
When you create a reference you bind it at it's initialisation. So from the beginning p is an alias to x. Where ever you see 'p', you can harmlessly replace it with 'x'. So the statement "p=z" is actually "x=z", which is valid. You've changed the value of 'x' not 'z'. If you print out the value of 'x' you should get 10. I think that's how it works.
@MIKE6789MW
@MIKE6789MW 3 күн бұрын
foolish to answer the dumb questions from the audience
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Storage Duration and Linkage in C and C++ - Dan Saks
58:14
NDC Conferences
Рет қаралды 8 М.
Core C++ 2019 :: Jason Turner :: The Best Parts of C++
1:07:04
CoreCppIL
Рет қаралды 17 М.
Back to Basics: Const as a Promise -  Dan Saks - CppCon 2019
1:01:34
East const but constexpr West - Dan Saks - code::dive 2018
16:15
code::dive conference
Рет қаралды 2,6 М.
The C++ rvalue lifetime disaster - Arno Schödl. think cell
53:54
Using std::cpp
Рет қаралды 4,9 М.
Class Layout - Miloš Anđelković - Meeting C++ 2023
58:00
Meeting Cpp
Рет қаралды 2 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН