Programming Tips - C++: Initialize a std::vector on the stack

Date: 2023aug1 Language: C++ Q. C++: Initialize a std::vector<> on the stack A. The standard now lets you say what you always wanted to:
#include <vector> void myfunction() { std::vector<int> a{ 10, 20, 30, 40, 50 }; ... }
This works in Microsoft Visual Studio 2017 and later.