Immediately after the conclusion of C++ and Beyond on August 10, Charles Torre from Microsoft's Channel 9 rounded up me, Herb Sutter, and Andrei Alexandrescu for an hour-long discussion of a variety of issues related to, well, C++ and beyond. That interview is now live, and I hope you enjoy it.
Scott
Thursday, August 25, 2011
Tuesday, August 16, 2011
C++11 Feature Availability Spreadsheet Updated
Now that C++ and Beyond 2011 is behind me, C++0x has been officially christened C++11 (or, as I like to think of it, "C++: The Spinal Tap Edition"), and Stephan T. Lavavej pointed me to his unbelievably easy to download and install binary of gcc 4.6 for Windows, I had time to play with gcc 4.6 and update my C++11 feature availability summary (now rechristened to reflect that "C++0x" is terminologically passé). Once again I found myself cackling with glee as I successfully built and ran programs with wacky stuff like
Because C++11 is no longer a draft standard (even if there are still some bureaucratic levers to be moved) and compiler support for C++11 is increasingly common, there's no need for me to keep updating the feature availability summary, so, modulo bugs in the existing data (I'll fix those as they're brought to my attention), I'm freezing it as is. That will give me more time to play around with the newly-minted and schnazzed up C++, and that's a lot more rewarding than putting little letters in boxes on a spreadsheet.
Have fun with C++11. How can you not?
Scott
andconstexpr int factorial(int n) noexcept { // define constexpr function!
return (n == 1) ? 1 : (n * factorial(n-1));
}
std::array<int, factorial(5)> a; // use it!
for (auto i : { 1, 2, 3, 4, 5} ) std::cout << i << " "; // range-based for!I mean, really, who can't love that? More complicated stuff works, too, like defaulting and deleting and automatically generating move operations. And nullptr (already present in VC10) joins the party, too. Fun, fun, fun.
Because C++11 is no longer a draft standard (even if there are still some bureaucratic levers to be moved) and compiler support for C++11 is increasingly common, there's no need for me to keep updating the feature availability summary, so, modulo bugs in the existing data (I'll fix those as they're brought to my attention), I'm freezing it as is. That will give me more time to play around with the newly-minted and schnazzed up C++, and that's a lot more rewarding than putting little letters in boxes on a spreadsheet.
Have fun with C++11. How can you not?
Scott