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



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to