type checking for typedefs in g++
Robert Dewar
dewar@gnat.com
Wed Aug 14 06:11:00 GMT 2002
>>Is there a way to use strict type checking (like in Ada) for g++?
This is a meaningless question. Both Ada and C++ are strongly typed
languages. The type models are different, for example there is no way
in C++ to distinguish between integer types, and no general derived
type model, but that's just a difference between the languages.
Some people would describe this as saying that Ada has stronger typing
than C++ and argue that this is an advantage. No doubt someone could
argue on the other side (though it's a bit of a stretch :-)
In any case, the idea of being able to use the Ada typing model in C++
makes zero sense. So, back to your question. If by "strict typing", you
mean that c++ should obey the strict typing rules in the C++ standard,
then it does (if you know a counterexample, submit it as a bug report).
If you mean by "strict typing" that you want g++ to use the Ada type model,
then the answer is certainly no! If you want the Ada type model, use Ada :-)
More information about the Gcc
mailing list