Comment

Comment by zzo38computer

What I had read somewhere is that some of the features of C++ are slow and will require runtime support with extra functions, but some features of C++ are as fast and efficient as C so is not a problem.

I dislike many of the features of C++ and would do them differently, although some things do help. For example, I think that they should not have allowed to overload = and , operators, and I think that features of GNU C such as zero-length arrays and zero-length structures are helpful even though apparently in C++ a structure cannot really have zero length (but in C it can), but my opinion is I think it should be possible for your own structure or union type to overload any operators that are not already defined, including reading through and writing through a pointer (if you define the structure type as having a specific type that it points to; by default it does not point to anything). For example:

  struct X x;
  struct X y;
  (...)
  *x=*y; // This line can be overloaded assignment and dereferencing
  x=y; // This line cannot be overloaded assignment
  x+y; // This line can be overloaded addition, since addition on structure types is not normally defined

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton