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! - Наука та технологія
Its very good info thanks
Cheers!
awesome! I wish you teach DSA problem solving in modernC++, paid course is still no one do it.
Something to consider in the future! 😀
Interesting. I hope that in one of the next videos you will talk about auto&&
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.
not the scary forwarding references !
when using "auto", IDE becomes important.
100%
Which C++ style guide do you follow?
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.
well, tNice tutorials is going to take forever...
More tutorials coming!