Classes Part 22 - Curly brace versus parenthesis and std::initializer_list| Modern cpp Series Ep. 59
Автор: Mike Shah
Загружено: 2022-05-07
Просмотров: 10955
►Full C++ Series Playlist: • The C++ Programming Language
►Find full courses on: https://courses.mshah.io/
►Join as Member to Support the channel: / @mikeshah
►Lesson Description: In this lesson I show you three different ways to initialize a variable (the fourth would be to perhaps not initialize the variable which is bad practice). In C++ there is a difference between using curly braces and parenthesis. Parenthesis will call the constructor and setup any arguments. Curly braces may also call the right constructor, but will also prevent narrowing (i.e. conversion of types). In addition, using curly braces to initialize an object will use a constructor with an std::initializer_list if one is defined.
►YouTube Channel: / mikeshah
►Please like and subscribe to help the channel!
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: