C++ From Scratch: std::move

Ғылым және технология

In this video we learn about the basics of std::move and move semantics in C++!
C++ Reference move constructors: en.cppreference.com/w/cpp/lan...
C++ Reference value categories: en.cppreference.com/w/cpp/lan...
C++ Reference std::move: en.cppreference.com/w/cpp/uti...
For code samples: github.com/coffeebeforearch
For live content: / coffeebeforearch

Пікірлер: 10

  • @rexseppe7084
    @rexseppe7084 Жыл бұрын

    Thanks for explaining!

  • @CoffeeBeforeArch

    @CoffeeBeforeArch

    Жыл бұрын

    Glad you enjoyed it! :^)

  • @anon_y_mousse
    @anon_y_mousse Жыл бұрын

    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.

  • @CoffeeBeforeArch

    @CoffeeBeforeArch

    Жыл бұрын

    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

  • @filipj4377

    @filipj4377

    Жыл бұрын

    Can you be more specific? You're super welcome to suggest a better design instead of saying it's bad in general

  • @anon_y_mousse

    @anon_y_mousse

    Жыл бұрын

    @@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

  • @yoavmor9002

    @yoavmor9002

    Ай бұрын

    @@anon_y_mousse Isn't

  • @anon_y_mousse

    @anon_y_mousse

    Ай бұрын

    @@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

  • @travelan
    @travelan11 ай бұрын

    I couldn't get through the video because 'std' does not stand for 'stud'. Either say S-T-D or 'standard'...

  • @8Trails50

    @8Trails50

    11 ай бұрын

    pretty lame reason to not get through the video

Келесі