by wsmith · 10y ago · 0 comments
I wonder how long it will take before C++ accidentally becomes a Lisp.
(Compiling C is mostly out the window now of course)
int *new = malloc(sizeof(int));
is valid C but invalid C++ for two different reasons: "new" is a keyword in C++, so you can't use it as an identifier, and C++ doesn't allow implicit casts from void*, while C does.:)
My current hobby project is a language VM that compiles cleanly as both C and C++. It took very little effort to get it working in C++ despite hacking on it for months as a strictly C project first.