$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Dave Harris (brangdon_at_[hidden])
Date: 2005-03-22 12:31:16
In-Reply-To: <004c01c52edb$d07ee5e0$6501a8c0_at_pdimov2>
pdimov_at_[hidden] (Peter Dimov) wrote (abridged):
> > Is it worth considering using x + x / sizeof(*p) instead?
>
> This will not work for incomplete types, including void.
Good point :-)
> I'd prefer equal hash_values for an incomplete T*, complete T*,
> and void* with the same value.
Indeed. Presumably this means casting to void* eg for the case where
sizeof(void*) != sizeof(char *).
> We'll lose one potential bit of enthropy when alignof(x) == 16, but
> this seems sufficiently rare in practice.
I was a bit concerned about cases where the heap produces a de facto
alignment. Especially if there is a different pool for each size of
object, or a user-defined X::operator new() that allocates from a huge
array of X. I guess it can't be helped.
-- Dave Harris, Nottingham, UK