I never heard anyone say that C++ is a superset of C. Sure, the first version was a preprocessor on top of C and certainly that is common knowledge. But a superset? Never heard it. ObjC on the other hand...
You evidently haven't been looking at the stackoverflow questions coming in at the [c] and [c++] tags... ;) A frightening amount of [c][c++] tagging is expunged there every day.
C++ is not a superset of C
21–30 of 114 posts
Re: C++ is not a superset of C
#22Very 1995, no offense.
Re: C++ is not a superset of C
#23Re: C++ is not a superset of C
#24Re: C++ is not a superset of C
#25> I'm suspicious of restrict. It seems like playing with fire, and anecdotally it seems common to run into compiler optimisation bugs when using it because it's exercised so little. On the contrary, I wish C++ had restrict in the standard, for exactly the reasons mentioned: it can help the optimizer in certain cases.
Indeed, auto-vectorization usually won't work without it...
I think it's easy to dismiss things that can help optimisation when you've never seen their effect first-hand. I imagine if I'd had an experience where I'd used it to great advantage I'd be wishing it was in the C++ standard too :)
Re: C++ is not a superset of C
#26Very 1995, no offense.
If yes, indeed.
I had to view in Reader mode via Firefox.
I could not read it, I got dizzy by its colors; my sensitive vision couldn't stand it -_-
Re: C++ is not a superset of C
#27I thought this was common knowledge? Pointer aliasing for example
Re: C++ is not a superset of C
#28Nit: memmove allows src and dst to overlap while memcpy does not.
I've never used restrict, so I could be missing something, but this is what I meant in the blog post by mentioning memmove.
Re: C++ is not a superset of C
#29* A char literal is an expression of type int in C, but type char in C++.
* String literals are const in C++ but non-const in C (although attempts to modify them are undefined behavior).
* This program is legal C but not C++:
int i;
int i;
* structs and unions occupy a different name space in C than they do in C++.* main cannot be recursive in C++, but it can in C.
* C++ allows lvalues in a few more places. Usually, this amounts to a compiler error, but there are a few places where the additional lvalue-to-rvalue conversion is legal and produces a different result.
* There are some cases where C++ requires an explicit cast that C permits an implicit cast (void* being the most well-known)
Re: C++ is not a superset of C
#30I never heard anyone say that C++ is a superset of C. Sure, the first version was a preprocessor on top of C and certainly that is common knowledge. But a superset? Never heard it. ObjC on the other hand...