|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-08-15 14:24:32
"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
news:ajgljl$7h2$1_at_main.gmane.org...
> [...]
> Temporarily unspecified:
> m_ptr = (char *) (U *) value - (char *) k
> [...]
Dave A.'s point is simply this:
Where in the standard does it guarantee that
(char*)(U*) value - (char*) k
points to a base class of U, for *any* k? While it seems certain that
there exists some k for which this is true, and while it seems probable
that you have computed that k, we have no assurance from the
standard that this will result in a valid pointer to a base class of U. Or,
at least, that is my understanding of what Dave A. said.
Dave
P.S. I thought typeof(T* - T*) == ptrdiff_t. Shouldn't it be
(char*) value - k?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk