ossrv_pub/boost_apis/boost/get_pointer.hpp
changeset 31 ce057bb09d0b
parent 0 e4d67989cc36
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     1 // Copyright Peter Dimov and David Abrahams 2002.
       
     2 // Distributed under the Boost Software License, Version 1.0. (See
       
     3 // accompanying file LICENSE_1_0.txt or copy at
       
     4 // http://www.boost.org/LICENSE_1_0.txt)
       
     5 #ifndef GET_POINTER_DWA20021219_HPP
       
     6 # define GET_POINTER_DWA20021219_HPP
       
     7 
       
     8 # include <memory>
       
     9 
       
    10 namespace boost { 
       
    11 
       
    12 // get_pointer(p) extracts a ->* capable pointer from p
       
    13 
       
    14 template<class T> T * get_pointer(T * p)
       
    15 {
       
    16     return p;
       
    17 }
       
    18 
       
    19 // get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
       
    20 
       
    21 template<class T> T * get_pointer(std::auto_ptr<T> const& p)
       
    22 {
       
    23     return p.get();
       
    24 }
       
    25 
       
    26 
       
    27 } // namespace boost
       
    28 
       
    29 #endif // GET_POINTER_DWA20021219_HPP