vrshoot
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/assimp/boost/pointer_cast.hpp Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,45 @@ 1.4 +////////////////////////////////////////////////////////////////////////////// 1.5 +// 1.6 +// (C) Copyright Ion Gaztanaga 2005. 1.7 +// Distributed under the Boost Software License, Version 1.0. 1.8 +// (See accompanying file LICENSE_1_0.txt or copy at 1.9 +// http://www.boost.org/LICENSE_1_0.txt) 1.10 +// 1.11 +////////////////////////////////////////////////////////////////////////////// 1.12 + 1.13 +#ifndef BOOST_POINTER_CAST_HPP 1.14 +#define BOOST_POINTER_CAST_HPP 1.15 + 1.16 +namespace boost { 1.17 + 1.18 +//static_pointer_cast overload for raw pointers 1.19 +template<class T, class U> 1.20 +inline T* static_pointer_cast(U *ptr) 1.21 +{ 1.22 + return static_cast<T*>(ptr); 1.23 +} 1.24 + 1.25 +//dynamic_pointer_cast overload for raw pointers 1.26 +template<class T, class U> 1.27 +inline T* dynamic_pointer_cast(U *ptr) 1.28 +{ 1.29 + return dynamic_cast<T*>(ptr); 1.30 +} 1.31 + 1.32 +//const_pointer_cast overload for raw pointers 1.33 +template<class T, class U> 1.34 +inline T* const_pointer_cast(U *ptr) 1.35 +{ 1.36 + return const_cast<T*>(ptr); 1.37 +} 1.38 + 1.39 +//reinterpret_pointer_cast overload for raw pointers 1.40 +template<class T, class U> 1.41 +inline T* reinterpret_pointer_cast(U *ptr) 1.42 +{ 1.43 + return reinterpret_cast<T*>(ptr); 1.44 +} 1.45 + 1.46 +} // namespace boost 1.47 + 1.48 +#endif //BOOST_POINTER_CAST_HPP