vrshoot

view libs/assimp/boost/pointer_cast.hpp @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line source
1 //////////////////////////////////////////////////////////////////////////////
2 //
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)
7 //
8 //////////////////////////////////////////////////////////////////////////////
10 #ifndef BOOST_POINTER_CAST_HPP
11 #define BOOST_POINTER_CAST_HPP
13 namespace boost {
15 //static_pointer_cast overload for raw pointers
16 template<class T, class U>
17 inline T* static_pointer_cast(U *ptr)
18 {
19 return static_cast<T*>(ptr);
20 }
22 //dynamic_pointer_cast overload for raw pointers
23 template<class T, class U>
24 inline T* dynamic_pointer_cast(U *ptr)
25 {
26 return dynamic_cast<T*>(ptr);
27 }
29 //const_pointer_cast overload for raw pointers
30 template<class T, class U>
31 inline T* const_pointer_cast(U *ptr)
32 {
33 return const_cast<T*>(ptr);
34 }
36 //reinterpret_pointer_cast overload for raw pointers
37 template<class T, class U>
38 inline T* reinterpret_pointer_cast(U *ptr)
39 {
40 return reinterpret_cast<T*>(ptr);
41 }
43 } // namespace boost
45 #endif //BOOST_POINTER_CAST_HPP