1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2005.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 //////////////////////////////////////////////////////////////////////////////
10 #ifndef BOOST_POINTER_CAST_HPP
11 #define BOOST_POINTER_CAST_HPP
15 //static_pointer_cast overload for raw pointers
16 template<class T
, class U
>
17 inline T
* static_pointer_cast(U
*ptr
)
19 return static_cast<T
*>(ptr
);
22 //dynamic_pointer_cast overload for raw pointers
23 template<class T
, class U
>
24 inline T
* dynamic_pointer_cast(U
*ptr
)
26 return dynamic_cast<T
*>(ptr
);
29 //const_pointer_cast overload for raw pointers
30 template<class T
, class U
>
31 inline T
* const_pointer_cast(U
*ptr
)
33 return const_cast<T
*>(ptr
);
36 //reinterpret_pointer_cast overload for raw pointers
37 template<class T
, class U
>
38 inline T
* reinterpret_pointer_cast(U
*ptr
)
40 return reinterpret_cast<T
*>(ptr
);
45 #endif //BOOST_POINTER_CAST_HPP