reinterpret_castsused for low-level tasks defined during implementation. According to the standard, it reinterpret_castscan be used for the following transformations (C ++ 03 5.2.10):
- Pointer to integral type
- Integral Type for Pointer
- A pointer to a function can be converted to a pointer to a function of another type
- - . , , .
- A B, A B
reinterpret_cast.
, reinterpret_cast , , char * unsigned char * .
static_cast , stg char *:
template<class ITER_T>
char *copy_binary(
unsigned char length,
const ITER_T& begin)
{
char* stg = alloc_storage(length);
std::copy(begin, begin + length, stg);
return stg;
}