4 ms·
> there are async await semantics There are coroutines in C++20 now. It has the async/await syntax except it's extensible to any kind of coroutine semantics, n
by zelly 6y ago
> there are async await semantics
There are coroutines in C++20 now. It has the async/await syntax except it's extensible to any kind of coroutine semantics, not just Futures like in Rust.
> locking is way better
RAII was inspired by C++. For making a mutex own its associated data, that's a simple template class which is a well-known pattern. You're also not forced to use it when it is not a good fit.
> The syntax is cleaner
You got me, I have been trolled.
- ironmagma 6y ago> It has the async/await syntax except it's extensible to any kind of coroutine semantics Interesting, I didn't know about this. > You're also not forced to use it when it is not a good fit. But like all language criticisms that contain this sentence, it's better when the language makes it somewhat tedious to go outside of the norm, where the norm is defined as the 99% use case. C++ is the opposite; you have to go out of your way to use the generic, safe features like smart pointers or create copy constructors. Rust's syntax takes cues from ML which means that things like switch statements (matches), if's, and even return are also expressions, which makes it nicer to refactor and allows you more choices when structuring your code.