|
Boost : |
From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2002-11-24 13:43:51
>From: "Pavol Droba" <droba_at_[hidden]>
Sorry for sending this as several mails.
> template< typename T >
> inline T offset_cast( void* p, unsigned int offset=0 )
> {
> return reinterpret_cast< T >( static_cast<unsigned char*>( p )+offset );
> }
There is also the issue of the interface. This "cast", unlike the other
casts, takes an additional parameter (the offset). This makes it look
different from the other casts, and this was rejected for
boost::lexical_cast for this reason. It has been suggested to add extra
parameters to lexical_cast, such as the stringstream to use for the
conversion, but this was not accepted.
Regards,
Terje
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk