C++ From Scratch: std::move
Вставка
- Опубліковано 18 жов 2024
- In this video we learn about the basics of std::move and move semantics in C++!
C++ Reference move constructors: en.cppreferenc...
C++ Reference value categories: en.cppreferenc...
C++ Reference std::move: en.cppreferenc...
For code samples: github.com/coff...
For live content: / coffeebeforearch
Thank you! A very clear, concise and jargon-free explanation.
I don't know if anyone else would agree, but I think if they had better defined some of the rules they could've avoided even needing std::move. A lot of both C and C++ strikes me as being weakly thought out. Almost as if the standards committees either had no real world experience or forgot whatever they did have. Not that I'm saying there's a perfect language, and in fact C and C++ are both still the best languages to use for general purposes. But that particular aspect I dislike vehemently and it seems as if a few more recent languages have copied it. Anyhow, that's just my own personal musing, feel free to disagree.
I'd say just the fact that move semantics is still so widely misunderstood would indicate that there is a problem with the standard. I think destructive moves are an interesting and intuitive alternative, but haven't honestly given it too much thought.
Cheers,
--Nick
Can you be more specific? You're super welcome to suggest a better design instead of saying it's bad in general
@@filipj4377 I doubt anyone from the committee would take any of my suggestions, and they aren't likely to see any of these posts, but Nick offered up one possible change that would be better. However, this is one case where I'd actually suggest extra syntax. Even something as simple as
@@anon_y_mousse Isn't
@@yoavmor9002 You're right. What I was thinking of wouldn't work in standard C++ because statements that are bare comparisons aren't treated differently to their usage in conditionals. Even something like `int foo = 0, bar = 0; foo
Thanks for explaining!
Glad you enjoyed it! :^)
stood move LMAO XDD
I couldn't get through the video because 'std' does not stand for 'stud'. Either say S-T-D or 'standard'...
pretty lame reason to not get through the video
@@8Trails50 no, its not