Hacker News new | past | comments | ask | show | jobs | submit login

The things C++ is missing include performance features. It's missing the "restrict" keyword.

https://en.wikipedia.org/wiki/Restrict

Some compilers offer "__restrict" or "__restrict__" in C++, but it's not standard. Standard C++ lacks the feature.

Besides "restrict", there is also the matter of theory not matching practice. The norm for C++ programmers is to be at least somewhat unaware of various extra copies and allocation. You know it's true. In practice, this makes the language slower.




C++ has std::valarray that has aliasing rules similar to the restrict keyword, allowing the same types of optimizations.


Forgive my ignorance, but doesn't std::unique_ptr communicate the same restriction, and therefore enable the same optimisations?


unique_ptr has unique ownership; it's not an error to use other pointers to the same data (just a bad idea).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: