B
BGB
Am 29.08.2012 00:03, schrieb Leigh Johnston:
That could well be possible. Did you read the previous discussion?
Otherwise your statement doesn't qualify for much more intelligence
than mine.
I just would prefered to have a reason that goes beyond something like
"we tradionally use void* like this". I still didn't get a consistent
reply why "void*" is needed in C++ (but for compability with C and for
"operator new").
compatibility with C would be the main thing here.
if the languages were merged, presumably everyone on both sides would
want their code to still work, preferably unmodified.
if it were a case where most existing C code broke, people wouldn't be
happy, and would just stay with C.
if it were a case where C++ were broke, then C++ people wouldn't be
happy, and would just stick with C++.
like, say, what if we renamed all of C++'s keywords, and made them
special defines where you had to include headers to enable them:
#include <stdclass.h>
#include <stdtemplate.h>
....
class Foo:IBar { ... };
otherwise it was just _Class and _Template and _Namespace and similar?...
a person could just be like "well, it is a trivial change, but go add
these here includes to every source-file and header which uses C++
related extensions".
as well as possibly needing a keyword for overloaded functions:
overload int foo(int x) { ... }
overload int foo(double x) { ... }
....
to be like "hey, this one might need name mangling!"
and, maybe classes are defined to have a strict mapping to structs
similar to that of COM objects, ...
it would likely be a no-go for C++ developers as well.
even if it were something as minor as adding:
#include <stdcplusplus.h>
to just a few files...
so, a compromise would likely be needed on many points.
It still seems that such discussions aren't possible and that at least
some people just react with ideology.
hopefully, I think at least I am more thinking in terms of being
pragmatic, even if, yes, such a merge is unlikely.
IMO, it is more the place of a language to provide a set of mechanisms,
not enforce any particular mindset or ideology.
What higher entity revealed you that commandment?
ironically, I do remember seeing C++ code in the past using "char *" for
many things which C people would normally use "void *" for.
"void *" makes a few stronger guarantees, which may be something at least.