11-09-2008, 06:46 PM
The text and rationale of rule 15-1-2 make no mention of the word `macro'. Let us suppose an application made no reference to the Standard Library within it's source code. Consequently, the `NULL' macro has not been defined. Would the following code violate rule 15-1-2?
The very premise of the rationale for the rule is invalid. In this case a `throw NULL;' is not equivalent to `throw (0);' and is not a throwing of an integer expression.
Furthermore, the wording of the rationale is slightly incorrect:
Code:
class A {};
A NULL;
void f()
{
throw NULL;
}
Furthermore, the wording of the rationale is slightly incorrect:
Quote:throw(NULL) (equivalent to throw(0)) is never a throw of the null-pointer-constant ...To quote ISO C++, 18.1, para. 4, (lib.support.types):
Quote:The macro NULL is an implementation-defined C++ null pointer constant in this International StandardGranted, the referenced `4.10' states a null pointer constant has integer (not pointer) type. However, the macro is a null pointer constant.
(4.10).