auto in Modern C++ | Modern Cpp Series Ep. 88

Поділитися
Вставка
  • Опубліковано 12 вер 2022
  • ►Full C++ Series Playlist: • The C++ Programming La...
    ►Find full courses on: courses.mshah.io/
    ►Join as Member to Support the channel: / @mikeshah
    ►Lesson Description: In this lesson I show you one of the more exciting features that was initially added to C++ 11, the repurposing of 'auto'. 'auto' is a placeholder for a type specifier, and allows the compiler to deduce the type for you. This can be handy for cleaning up your code, though I will have a warning that it does not always do what you may expect, so you do have to be a little careful with auto.
    ►UA-cam Channel: / mikeshah
    ►Please like and subscribe to help the channel!
  • Наука та технологія

КОМЕНТАРІ • 13

  • @minecraftcookie2929
    @minecraftcookie2929 4 місяці тому +1

    Its very good info thanks

  • @swipekeys4865
    @swipekeys4865 Рік тому +2

    awesome! I wish you teach DSA problem solving in modernC++, paid course is still no one do it.

    • @MikeShah
      @MikeShah  Рік тому +1

      Something to consider in the future! 😀

  • @az6876
    @az6876 Рік тому +2

    Interesting. I hope that in one of the next videos you will talk about auto&&

    • @MikeShah
      @MikeShah  Рік тому +2

      I think there is indeed more to the 'auto' story :) auto itself is really useful I think for the use case where you really need to use it, meaning you want to write generic code and be able to let the compiler do the hard work of deducing the correct type what the variable would be. Of course, the situation you mention, with even 'auto&' as a reference type in a 'for-each' loop is useful for folks to understand the difference.

    • @vedantranade1815
      @vedantranade1815 3 місяці тому

      not the scary forwarding references !

  • @ghulam2545
    @ghulam2545 Рік тому +2

    when using "auto", IDE becomes important.

  • @bsdooby
    @bsdooby Рік тому +1

    Which C++ style guide do you follow?

    • @MikeShah
      @MikeShah  Рік тому +1

      Most of the time I peek at Google's if I'm unsure as they have the most encyclopedic guide. Companies I've worked at also usually default me into their style, so that's how my own personal style has evolved I suppose.

  • @user-fb6gs8mu5n
    @user-fb6gs8mu5n Рік тому +1

    well, tNice tutorials is going to take forever...

    • @MikeShah
      @MikeShah  Рік тому

      More tutorials coming!