epoc32/include/stdapis/boost/pointer_cast.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 //////////////////////////////////////////////////////////////////////////////
     2 //
     3 // (C) Copyright Ion Gaztaņaga 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 //////////////////////////////////////////////////////////////////////////////
     9 
    10 #ifndef BOOST_POINTER_CAST_HPP
    11 #define BOOST_POINTER_CAST_HPP
    12 
    13 namespace boost { 
    14 
    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 }
    21 
    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 }
    28 
    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 }
    35 
    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 }
    42 
    43 } // namespace boost
    44 
    45 #endif   //BOOST_POINTER_CAST_HPP