|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-12-04 10:06:07
Gabriel Dos Reis <gdr_at_[hidden]> writes:
> "David B. Held" <dheld_at_[hidden]> writes:
>
> | Does this have any merit whatsoever?
> |
> | template <typename T, typename U>
> | T* dangerous_cast(U* p)
> | {
> | return static_cast<T*>(static_cast<void*>(p));
> | }
>
> Is it any different from reinterpret_cast<T*>(p) ?
It might be, depending on your compiler. The behavior of
reinterpret_cast<T*> is implementation-defined.
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk