Boost logo

Boost :

From: Dirk Gerrits (dirk_at_[hidden])
Date: 2002-11-24 12:30:46


Pavol Droba wrote:

> Hi,
>
> I have developed a simple cast function which I found very useful.
> Here it is:
>
> template< typename T >
> inline T offset_cast( void* p, unsigned int offset=0 )
> {
> return reinterpret_cast< T >( static_cast( p )+offset );
> }
>
> template< typename T >
> inline T offset_cast( const void* p, unsigned int offset=0 )
> {
> return reinterpret_cast< T >( static_cast( p )+offset );
> }

Why only unsigned offsets?

Dirk Gerrits


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