#include <iostream> #include <initializer_list> int main(int argc, char *argv[]) { //initialization std::initializer_list<int> l; l = {10, 20, 30, 40}; //size std::cout<<"Size: "<<l.size()<<std::endl; //access elements for(auto e : l) std::cout<<e<<" "; std::cout<<std::endl; for(auto it = l.begin(); it != l.end(); ++it) std::cout<<*it<<" "; std::cout<<std::endl; return 0; }