4 ms·
C arrays are better than this mess. All the problems caused by the intervening generic programming abstraction machinery disappear.
by kevin_thibedeau 6mo ago
C arrays are better than this mess. All the problems caused by the intervening generic programming abstraction machinery disappear.
- compiler-guy 6mo agoThe 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.
- SuperV1234 6mo agoDidn't know you could use C arrays to get static compile time reflection, guess C was really ahead of its time!
- kevin_thibedeau 6mo agoWrap them in a class with a consteval constructor.