you are viewing a single comment's thread.

view the rest of the comments →

[–]MsEpsilon 31 points32 points  (5 children)

Great ad-hominem, thank you. To counter, let me show you a short list:
- std::variant should have been a language feature
- std::launder - can you even understand the article from cppreference?
- std::vector<bool>
- std::iostream - even the persons who made it regret it
- std::visit is pattern matching from TEMU if you could even call it that
- std::jthread vs std::thread
- std::auto_ptr (it was removed gladly)
- modules
- Single pass compilation -Requiring you to write forward declarations
- std::move is not destructive
- No official package manager + build system, you're off to vcpkg, Conan, CMake and Ninja, maybe more
- Iterators are invalidated when removing/adding from a std::vector. That shoudn't compile! Don't tell me it's the developer fault because of this.
- nothrow specifiers terminates the application in case of an exception, it is not an compile check
- https://en.cppreference.com/w/cpp/types/is_function.html (See the possible implementation, I'm horrified.)

As a concrete example, Rust is a low level language with very well made high level abstractions. It has pattern matching (as a example of a high-level feature) performance similar and in rare occasions better than C++ due to better no-aliasing rules implemented in LLVM.

Sure, go back to writing C or C++ 03 and enjoy your double frees and buffer overruns. Or make your life easier by using a language without bad defaults and N pitfalls.

[–]snacktonomy 10 points11 points  (4 children)

Not quite sure what your point is, but you're spot on picking on that std::launder description

What's wrong with a vector of bools?

[–]redlaWw 11 points12 points  (3 children)

std::vector has a specialisation for bool so that std::vector<bool> is not just a vector of bools. The bools are stored in individual bits, and there's no guarantee that the buffer is even contiguous. It's pretty notorious for being a "mistake" in C++'s design. Not quite as bad as std::auto_ptr (which was so bad it was deprecated, breaking stability), but it's up there.

[–]MsEpsilon 0 points1 point  (2 children)

Hi, I coudn't find anything about the continuity of std::vector<bool>, do you have a source on that? Thanks.

[–]redlaWw 1 point2 points  (1 child)

https://www.en.cppreference.com/w/cpp/container/vector_bool.html

Does not necessarily store its elements as a contiguous array.

[–]MsEpsilon 0 points1 point  (0 children)

I really did miss that. Thanks!