Boost logo

Boost :

Subject: Re: [boost] [wave][function] Suppressing gcc-4.4.1 warnings
From: Jeffrey Bosboom (jbosboom_at_[hidden])
Date: 2009-11-07 02:49:56


Gottlob Frege wrote:
> 2. What is left for reinterpret_cast to do? casting to/from ints to
> pointers, etc? (useful in lockfree programming, etc). Which would be
> better accomplished with unions I suppose.

Casting from pointer-to-function to pointer-to-object types (e.g.,
void*) is conditionally-supported for reinterpret_cast, and there's a
guarantee that if both directions are supported, you can call through
the pointer after casting it back to its original type. static_cast
can't do this. (There's also the question of why you'd do this at all
-- if you really need a typeless function pointer, you can cast to
void(*)() with static_cast.)

--Jeffrey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk