3 ms·
Wait, is that an integer, or an array? Serious question, with initialiser lists I'm not sure any more.
by loup-vaillant 9y ago
Wait, is that an integer, or an array? Serious question, with initialiser lists I'm not sure any more.
- wyldfire 9y agoDon't sweat it, it's `auto.` Whatever you meant it to be will be deduced by the compiler. ;)
- claudius 9y agoauto 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.