3 ms·
That and destructors, maybe some constexpr evaluated stuff like C++ is doing now, and then really C would become way funner to code in.
by psyclobe 7y ago
That and destructors, maybe some constexpr evaluated stuff like C++ is doing now, and then really C would become way funner to code in.
- quotemstr 7y agoSo just write in C++ and don't use the parts you don't like. I've never understood the almost-reflexive aversion to C++ you see in some low-level circles. If you don't want huge Java-style class hierarchies, don't make them. If you don't want templates to bloat your code, use templates sparingly and take advantage of type erasure. You can make a C++ program look like anything you want.
- convolvatron 7y agoyes you can. but if you walk into a C++ shop, every developer has thrown in a few of their favorite tricks. everyone says they are using a 'sane subset', but it always seems to turn out to be 'most of it'.
- quotemstr 7y agoThe people who use the phrase "sane subset" are those who in my experience distort C++ beyond recognition by banning particular features of the language wholesale rather than shaping the programs that they write to fit the environment. You should be using the whole C++ language. There's no such thing as a "sane subset", because all of the language has "sane" uses. What you want is to create good programs.
- saagarjha 7y agoIt’s a GNU extension, and not quite the same as a destructor, but __attribute__((cleanup)) might be useful for your use case.