Hacker News new | ask | show | jobs
by kevin_thibedeau 57 days ago
C arrays are better than this mess. All the problems caused by the intervening generic programming abstraction machinery disappear.
2 comments

The nice thing about C++ is that if you want to use plain old C arrays, you can. And there will be no extra overhead over plain C.

You will lose many nice features like fancy strings and easy array resizing (which may or may not be acceptable to you), but you don’t have to pay for it if you don’t use it. (Mostly)

This does seem pretty complicated. And I doubt I will ever use it. But for some the trade off is worth it, and they get to make the choice.

Didn't know you could use C arrays to get static compile time reflection, guess C was really ahead of its time!
Wrap them in a class with a consteval constructor.