11 ms·
Wait, so the words "concepts" and "requires" were newly made keywords, and this breaks code, but the words "yield" and "await" were determined too important and
by misnome 4y ago
Wait, so the words "concepts" and "requires" were newly made keywords, and this breaks code, but the words "yield" and "await" were determined too important and too common to standards members that they needed to be renamed to the horrifically ugly "co_await" and "co_yield"?
Also, last time I actually tried to use C++20 none of the standard library implementations had std::format; has this changed now?
- deleted 4y ago[deleted]
- StephanTLavavej 4y agostd::format is available, with all C++20 Defect Reports implemented, in VS 2019 16.11.14 (and all later 16.11.x) and VS 2022 17.2 (and all later 17.x).
- AlexeyBrin 4y ago> last time I actually tried to use C++20 none of the standard library implementations had std::format; has this changed now? MSVC is the only major implementation that has std::format for now.
- Forricide 4y agoIt's so funny to me that MSVC has become the cutting edge of C++ standards implementation. I remember starting out when it was a joke compared to Clang - although I was a novice, so who knows how complete my knowledge was at the time. In any case, it's a really impressive effort from STL and the rest of their library team. STL has some incredible CPPCon talks, too.
- tialaramex 4y agoOne way you could interpret this (definitely not the only way) would be that Microsoft - or some group within Microsoft - sees C++ as a possible legacy system, with an opportunity to make a lot of money by judging correctly what customers want and how much income you need to justify that support as existing offerings rust out (so to speak). Do you have any particular CPPCon talks to recommend ? My favourite is "Abseil's Open Source Hashtables: 2 Years In" by Matt Kulukundis, Matt's a fine speaker but what makes it so fun is that Hyrum Wright is in the audience yelling interjections as a result of Hyrum's law (this is scripted). For example Matt explains a significant size optimisation for people who only have a few things in their map, it's just smaller with no other consequences - right? Hyrum points out that now rehash happens earlier, so if you depend on it not to invalidate references during the first 15 insertions you are screwed. Guess whether any real Google code did that...
- Forricide 4y agoI really love this talk in particular: https://www.youtube.com/watch?v=4P_kbF0EbZM https://www.youtube.com/watch?v=4P_kbF0EbZM (On charconv) But any of the ones I've seen from Stephan have been fantastic, I think, although I'm not actually sure if I've seen more. He seems to have a lot of talks on very specific subjects, which can be really fun. > Hyrum Wright is in the audience yelling interjections as a result of Hyrum's law This sounds absolutely hilarious, I'll have to take a look.
- StephanTLavavej 4y agoI'm glad you liked my charconv talk! Here's a complete list of my recorded conference talks: BoostCon/C++Now 2012: Regex In C++11 And Boost: https://youtu.be/mUZL-PRWMeg https://youtu.be/mUZL-PRWMeg GoingNative 2012: STL11: Magic && Secrets: https://docs.microsoft.com/en-us/events/goingnative-2012/stl11-magic-secrets https://docs.microsoft.com/en-us/events/goingnative-2012/stl... GoingNative 2013: Don't Help The Compiler: https://docs.microsoft.com/en-us/events/goingnative-2013/don-t-help-compiler https://docs.microsoft.com/en-us/events/goingnative-2013/don... GoingNative 2013: rand() Considered Harmful: https://docs.microsoft.com/en-us/events/goingnative-2013/rand-considered-harmful https://docs.microsoft.com/en-us/events/goingnative-2013/ran... CppCon 2014: STL Features And Implementation Techniques: https://youtu.be/dTeKf5Oek2c https://youtu.be/dTeKf5Oek2c CppCon 2015: functional: What's New, And Proper Usage: https://youtu.be/zt7ThwVfap0 https://youtu.be/zt7ThwVfap0 CppCon 2016: tuple: What's New, And How It Works: https://youtu.be/JhgWFYfdIho https://youtu.be/JhgWFYfdIho CppCon 2018: Class Template Argument Deduction for Everyone: https://youtu.be/-H-ut6j1BYU https://youtu.be/-H-ut6j1BYU CppCon 2019: Floating-Point charconv: Making Your Code 10x Faster With C++17's Final Boss: https://youtu.be/4P_kbF0EbZM https://youtu.be/4P_kbF0EbZM CppCon 2020: C++20 STL Features: 1 Year of Development on GitHub: https://youtu.be/8kjRx8vo6y4 https://youtu.be/8kjRx8vo6y4 Pure Virtual C++ 2022: MSVC C++20/23 Update: https://youtu.be/DAl37n2XOwk https://youtu.be/DAl37n2XOwk
- Forricide 4y agoThat's a way better list than what I had! Thanks! Think I'll watch the rand() talk tomorrow, I love (to hate on) rand.
- fouronnes3 4y agoOne day in the far away future the standard C++ hello world will use 'import std;' and 'std::print' and it will be glorious.
- jmillikin 4y agoWhen I was going to university the computer science department's primary system had two compilers available, GCC 2.96[0] and TenDRA. GCC was generally more popular but it didn't have std::string and any code that threw an exception would crash, so adventurous students would use TenDRA for development. One of the stranger behaviors of TenDRA was that it put all standard library symbols, including the C headers, into namespace std. A hello world in TenDRA looked like this: #include <cstdio> // no <stdio.h> available int main() { std::printf("Hello, world!\n"); return 0; } It was not glorious. If anything ... the opposite. When TenDRA deigned to compile your program it would generally work (excepting bugs in the code itself), but getting it to accept any sort of third-party code was impossible because of the std namespace thing. I ended up writing a bunch of utilities for strings, including a unit testing library that spawned each test as a subprocess (to avoid exceptions) just so I could use GCC instead. [0] There is no such version recorded on the GNU project website.
- jdougan 4y agoGCC 2.96 was a development version that incorrectly got released by Redhat on Redhat 7 (and possibly other distros). https://gcc.gnu.org/legacy-ml/gcc-announce/2000/msg00003.html https://gcc.gnu.org/legacy-ml/gcc-announce/2000/msg00003.htm...
- jmillikin 4y agoThis was on a DEC Tru64 system, very far from any sort of Linux. My personal suspicion is that someone (student or faculty) got their hands on a CVS snapshot and installed it system wide. That's the only explanation I can think of for it being so broken.
- alternatetwo 4y ago
- layer8 4y ago`std::this_thread::yield` already existed at the time, and “yield” was presumed to also be a common identifier in financial and agricultural contexts. I’m nevertheless surprised that new noncontextual and previously-unreserved-identifier keywords were added at all. In earlier times, the approach would have been to use a reserved identifier like “_Yield” for the keyword, and to provide a standard opt-in header that would `#define yield _Yield`. Maybe they don’t want to add dependencies on the preprocessor anymore.
- Sharlin 4y agoI’m not sure C++ has ever used the `_Yield` hack, except for C compatibility? C on the other hand uses it all the time.
- layer8 4y agoIt could be that I'm remembering it from C.
- chippiewill 4y agoIt's super common in C because C doesn't have namespaces and templates which means stuff C++ implements as namespaced library classes C has to implement as language keywords. A good example is atomics. C++11 introduced `std::atomic`, C11 introduced the keyword `_Atomic`
- nickysielicki 4y agoSuch a weak argument, you can fix this in your entire code base with a single call to sed. There is no reason to introduce a language feature with some weird prefix instead of changing existing code and having them prefix their variable names.
- nickysielicki 4y agoThe east coast fintech folks are the reason we couldn’t have yield as a keyword. Too much of their code uses the variable name yield in the trading sense of the word, and so we’re stuck with this instead. This is what someone on the standards committee told me on the cpp slack a few years ago, at least.