Boost logo

Boost :

Subject: Re: [boost] boost/pool/pool.hpp why reinterpret_cast instead ofstatic_cast?
From: James Talbut (James.Talbut_at_[hidden])
Date: 2009-03-13 05:07:10


> >>
> >> It is my understanding that void* to T* convertions should be done
using
> >> static_cast and not reinterpret_cast.
> >
> >
> > No one knows? No one cares?
>
> I care; it's one of my favorite axen to grind. Yes, avoid
> reinterpret_cast unless you really want implementation-defined
behavior.

Can you expand on that?
Casting from void* to T* (or X* to Y*) is precisely when I'd use
reinterpret_cast (and, indeed, it's not much use for anything else).

Jim

________________________________________________________________________
This e-mail, and any attachment, is confidential. If you have received it in error, do not use or disclose the information in any way, notify me immediately, and please delete it from your system.
________________________________________________________________________


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