Is the comma (,) a sequence point in std::initializer_list?
example: is this UB or not:
#include <vector> int main() { auto nums = [] { static unsigned x = 2; return ( x++ % 2 ) + 1; }; std::vector< int > v{ nums(), nums(), nums(), nums(), nums() }; // not sure if this is different: (note the additional brackets) // std::vector< int > v({ nums(), nums(), nums(), nums(), nums() }); for( auto i : v ) { std::cout << i; } return 0; }
initializer_listconstructor ofvectorwith aninitializer_listconstructed via list-initialization.