3 ms·
In a recent project the juniors pushed for C++17 use; I've never seen so many code comments about compiler bugs in a single project that size. It targets only t
by blattimwind 9y ago
In a recent project the juniors pushed for C++17 use; I've never seen so many code comments about compiler bugs in a single project that size. It targets only two platforms using GCC and clang.
This is not to say that compiler developers do a bad job; however, don't expect complex language revisions to be production grade from the get-go.
- leeter 9y agoGenerally I'd stick to C++14 features but test and consider C++17 library features as those are usually much more stable. Around the C++20 timeframe C++17 should be fully stable.
- ahartmetz 9y agoDon't go too far, or you'll get... auto i = { 1 };
- loup-vaillant 9y agoWait, 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.
- gumby 9y agoWe’ve had good success with c++17 starting with an “blank buffer” application about a year ago. The code is clearer and so has fewer bugs. It helped that starting from zero allowed us to enable almost every compiler warning in g++ and clang++. The bigger problem is interfacing with third party code that has to work with everything back to c+03. I don’t envy those folks in their task!