|
Boost : |
From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-12-08 12:47:25
--- Gabriel Dos Reis <gdr_at_[hidden]> wrote:
> Gennaro Prota <gennaro_prota_at_[hidden]> writes:
>
> [...]
>
> | > I haven't
> | >| found a definition of "pointer to object" in the standard; anyhow
> | >| certainly void is not an object type.
> | >
> | >void* is the generic type of "pointer to object."
> |
> | Well, as I said I don't find any definition of the expression "pointer
> | to object" (though, of course, I do know that you can point to an
> | object through a void*).
>
> I don't know how formal you want a definition for pointer to object to
> be defined; but I, personnally, find 3.9.2 sfficiently acceptable.
Yeah, I'm not criticizing that paragraph. It's just that probably nobody
thought to clarify that aspect; it's clear that a void* object can hold any
object pointer value. It is not clear to me if it *is* a "pointer to an object"
for the purpose of the sentence:
"A pointer to an object can be explicitly converted to a pointer to an
object of different type"
> | In any case, do you agree that at least the
> | result is unspecified?
>
> I don't think I agree with this part; at least if it means anything
> other that converting a Foo* to void*.
Well, then I don't think we can establish "the truth" either. At this point we
are just trying to "crack" the standard in the hope of reading something that
probably the writer wasn't thinking of. That's often a danger in the "exegesis"
of the standard. I find it's up to the good sense of the reader to stop
investigating in such cases (just to give you an example: if you try at all
costs to read a meaning in every single word of the standard, you may conclude
that
char * p = ...
reinterpret_cast<char*>(p)
is illegal, because the sentence above talks about conversion to *a different*
type. And the conversions that are not listed cannot be done with
reinterpret_cast).
Genny.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk