ossrv_pub/boost_apis/boost/pointer_cast.hpp
author andy simpson <andrews@symbian.org>
Wed, 16 Jun 2010 08:14:03 +0100
branchGCC_SURGE
changeset 36 6a60b9d459b4
parent 0 e4d67989cc36
permissions -rw-r--r--
GCCE fixes (Bug 2971) (see also Bug 1713 on CompilerCompatibilty branch) : Remove overqualified method name and change check for ULong to not try and test typedef

//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztaņaga 2005. 
// Distributed under the Boost Software License, Version 1.0. 
// (See accompanying file LICENSE_1_0.txt or copy at 
//  http://www.boost.org/LICENSE_1_0.txt)
//
//////////////////////////////////////////////////////////////////////////////

#ifndef BOOST_POINTER_CAST_HPP
#define BOOST_POINTER_CAST_HPP

namespace boost { 

//static_pointer_cast overload for raw pointers
template<class T, class U>
inline T* static_pointer_cast(U *ptr)
{  
   return static_cast<T*>(ptr);
}

//dynamic_pointer_cast overload for raw pointers
template<class T, class U>
inline T* dynamic_pointer_cast(U *ptr)
{  
   return dynamic_cast<T*>(ptr);
}

//const_pointer_cast overload for raw pointers
template<class T, class U>
inline T* const_pointer_cast(U *ptr)
{  
   return const_cast<T*>(ptr);
}

//reinterpret_pointer_cast overload for raw pointers
template<class T, class U>
inline T* reinterpret_pointer_cast(U *ptr)
{  
   return reinterpret_cast<T*>(ptr);
}

} // namespace boost

#endif   //BOOST_POINTER_CAST_HPP