Towards Modern C++: Declaration and Initialization
2.1) Universal Declaration
Modern C++ allows usage of braces to initialize almost anything in C++.
vector<int> vec{1,2,3,4,5};
string s{“Hello World!”};
string _str{‘H’, ‘E’, ‘L’, ‘L’, ‘O’ };
int x{9};
Advantages of Universal Declaration
Narrowing ...
shantanudubey.hashnode.dev3 min read