I wish. Unfortunately I think it is we who are doomed and stuck with it forever.
Is C++ Doomed?
21–30 of 168 posts
Re: Is C++ Doomed?
#22This seems like the beginning of a bad situation. I mean, this shows why constructors that do any complex work that can error out are a bad idea.
Re: Is C++ Doomed?
#23The commentary is good, but the conclusion is unsupported. These are annoying issues, but doom they do not make.
Re: Is C++ Doomed?
#24* Move semantics itself requires a whole book https://www.cppmove.com/.
* RVO has always confused me. It was much simpler in the C++03 days. Copying large objects by value was inefficient. So you always used references. Period.
* Don't fully agree with the commentary on exceptions; it's the same in most other languages if you want resources to be freed/given back.
Re: Is C++ Doomed?
#25Re: Is C++ Doomed?
#26I should note that writing data structures in rust is also a fraught business! In practice, that’s just a property of languages that don’t have garbage collection. Exception safety is a serious complication in c++! Exceptions were a mistake in the language, particularly given the existence now of std::optional.
Finanally, c++ is the only language I would ever want to do linear algebra in, or for that matter, many graph algorithms. Rust is adding features to make it useful for linalg, but it’s not their yet. Linear algebra is important!
Isn't something like MATLAB better for linear algebra than C++?
Re: Is C++ Doomed?
#27These are not the only options. You can also return `optional` or an other wrapped value from a factory function.
Re: Is C++ Doomed?
#28On a long enough timeline I do believe C++ is doomed or will otherwise become something completely unrecognizable from its current form. Similar to how C++98 code is wildly different than modern C++ code. People often ask, "is C++ a good language?" or "is XXX better than C++?". Doesn't really matter, what matters is whether people are willing to pay the "tax" of learning/using/maintaining C++. C++ is a generalist lan…
Re: Is C++ Doomed?
#29No. The FILE example is either bad, tired, lazy or shows lack of knowledge of the standard library. A better way of opening/closing the FILE with RAII is right in the example [0] of unique_ptr at the wonderful cppreference.com:
std::ofstream("demo.txt") ;
unique_file_t fp(std::fopen("demo.txt", "r"), &close_file);
if (fp)
std::cout
I'm sorry, I'm not trying to be negative towards the author, but you need a better example than opening/closing FILE if you're going to make a compelling argument about the looming death of C++.Re: Is C++ Doomed?
#30The commentary is good, but the conclusion is unsupported. These are annoying issues, but doom they do not make.
https://github.com/hsutter/708 is a C++ proposal which unifies placement constructors and writable out-parameters ("definite first use"). I don't think it makes placement initialization fallible, but I'm not sure.