$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
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