1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/pointer_cast.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,45 @@
1.4 +//////////////////////////////////////////////////////////////////////////////
1.5 +//
1.6 +// (C) Copyright Ion Gaztaņaga 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