Can I convert a null pointer of int to a long type by reinterpret_cast

int * pt = 0;
long i = reinterpret_cast (pt);

Гарантированно ли мне будет 0? Это четко определено или определено реализацией? I checked the c++ standard, but it only states that

A pointer to a data object or to a function (but not a pointer to member) can be converted to any integer type large enough to contain it.

In this case, pt doesn't point to any data object. Does the rule apply to this case?

9
задан C-- 12 April 2011 в 08:49
поделиться