4 ms·
> You can use C++ as some kind of C with destructors though :P Scoped cleanup is really a nice thing.. C++ is not a strict superset of C. You actually have to
by beefhash 8y ago
> You can use C++ as some kind of C with destructors though :P Scoped cleanup is really a nice thing..
C++ is not a strict superset of C. You actually have to cast void pointers, for example.
> But then you also want templates of course to get rid of your void*.
No, actually, I think I can live without that, but thank you.
> And oh, wait, what's that? A cross-platform thread implementation (well, sort of, depends on platform)?
C11, threads.h. Been there, got that.
> A string thing which I can search without strstr?
Okay, I'll give you that, string handling is hell.
> Anonymous functions which capture?
Have their uses, but I'm not sure if C is really the right place for it.
> Auto?
auto (as used in C++11 and later) is a solution in need of a problem in C. When you don't have piles of templates and iterators, you also tend not to need to automatically derive types. In a world where signed/unsigned integer comparison can have fatal consequences, you probably do want to be very sure about your types.
- rubber_duck 8y ago>C++ is not a strict subset of C. I think you flipped this :) ?
- stinos 8y ago> C++ is not a strict superset of C. I know that. I use both C and C++ practically daily. The post was partly joking. But only partly (for example of course I could live without templates if really needed but seriously they make some jobs a lot better and easier). Hence I aptly phrased it some kind of C hoping (idly it seems) no one would trip over it because it's obviously not C.