Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C11 atomics, C11 threads, variable length arrays, safely reading from an inactive union member, designated array initializers, compound struct literals, implicitly converting a void pointer to a typed one, and the list goes on.


C++ has its own atomics, threads etc. And variable length array's work just fine in C++ in both clang and GCC.

C++ also has it's own designated initializer like syntax.


>C++ has its own atomics, threads etc.

It does indeed, but they are not compatible and at least the C atomics cannot be used from C++.

>C++ also has it's own designated initializer like syntax.

One that is far more limited. This is valid C, but not C++.

  struct bar {
      int a;
      int b;
  };
  
  struct bar tmp = {
      .b = 0,
      .a = 0,
  };


Indeed, and some of those, thankfully as C++ is TypeScript for C.




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

Search: