3 ms·
auto i = {5}; is a std::initializer_list<int>, whereas auto i{5}; is an int (as of C++17): https://godbolt.org/g/eXXN3o https://godbolt.org/g/eXXN3o See
by claudius 9y ago
auto i = {5};
is a std::initializer_list<int>, whereas
auto i{5};
is an int (as of C++17): https://godbolt.org/g/eXXN3o https://godbolt.org/g/eXXN3o
See also https://stackoverflow.com/questions/25612262/why-does-auto-x3-deduce-an-initializer-list https://stackoverflow.com/questions/25612262/why-does-auto-x... .
- ddavis 9y agoIf you change the compiler version (to e.g. gcc7) your blurb compiles in C++14.