I agree they need a build system like cargo, though cmake kind of works for me.
with carbon and cppfront in the works,c++ will keep evolving
11–20 of 110 posts
I agree they need a build system like cargo, though cmake kind of works for me.
with carbon and cppfront in the works,c++ will keep evolving
A few things I've found notoriously difficult to do in C++: 1. Add two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit integers. If the sum is going to overflow, generate an error. If the sum is not going to overflow, evaluate the sum. 2. Multiply two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit in…
A few things I've found notoriously difficult to do in C++: 1. Add two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit integers. If the sum is going to overflow, generate an error. If the sum is not going to overflow, evaluate the sum. 2. Multiply two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit in…
A few things I've found notoriously difficult to do in C++: 1. Add two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit integers. If the sum is going to overflow, generate an error. If the sum is not going to overflow, evaluate the sum. 2. Multiply two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit in…
I use them all the time.
A few things I've found notoriously difficult to do in C++: 1. Add two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit integers. If the sum is going to overflow, generate an error. If the sum is not going to overflow, evaluate the sum. 2. Multiply two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit in…
A few things I've found notoriously difficult to do in C++: 1. Add two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit integers. If the sum is going to overflow, generate an error. If the sum is not going to overflow, evaluate the sum. 2. Multiply two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit in…
If you use MSVC maybe it's more of an issue, but on GCC and Clang we have __builtin_overflow_*. There are many variants: https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins... I use them all the time.
> the pool of engineers with C++ background is much larger than the pool of Rust developers Well that's pointless.
I agree. I'm using it both in the game server, the client and for scripting! So far I haven't really had any serious problems that would be related to unsafety. You just have to be disciplined. Source: https://medium.com/@fwsgonzo/using-c-as-a-scripting-language... I do see that peoples experience with C++ varies wildly, because shops either don't understand why modern C++ exists or they don't care. Either way, predi…
Maybe you are at a higher level than them though.
A few things I've found notoriously difficult to do in C++: 1. Add two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit integers. If the sum is going to overflow, generate an error. If the sum is not going to overflow, evaluate the sum. 2. Multiply two signed 64-bit integers without overflowing on either side (negative or positive) and without using 128-bit in…
> Does Rust make this kind of problems easy to be solved?
For this specific case (specified behavior on overflow), Rust makes it trivial. All of the primitive integer types have methods such as `checked_mul()` or `saturating_add()`, which provide deterministic arithmetic on all platforms.all my new projects are in c17 and c++20,no rust for me. I agree they need a build system like cargo, though cmake kind of works for me. with carbon and cppfront in the works,c++ will keep evolving
But yes, CMake is something I do not miss. Though I miss the alternatives even less. Though C++ with Bazel is actually quite attractive.