epoc32/include/stdapis/boost/get_pointer.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright Peter Dimov and David Abrahams 2002.
williamr@2
     2
// Distributed under the Boost Software License, Version 1.0. (See
williamr@2
     3
// accompanying file LICENSE_1_0.txt or copy at
williamr@2
     4
// http://www.boost.org/LICENSE_1_0.txt)
williamr@2
     5
#ifndef GET_POINTER_DWA20021219_HPP
williamr@2
     6
# define GET_POINTER_DWA20021219_HPP
williamr@2
     7
williamr@2
     8
# include <memory>
williamr@2
     9
williamr@2
    10
namespace boost { 
williamr@2
    11
williamr@2
    12
// get_pointer(p) extracts a ->* capable pointer from p
williamr@2
    13
williamr@2
    14
template<class T> T * get_pointer(T * p)
williamr@2
    15
{
williamr@2
    16
    return p;
williamr@2
    17
}
williamr@2
    18
williamr@2
    19
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
williamr@2
    20
williamr@2
    21
template<class T> T * get_pointer(std::auto_ptr<T> const& p)
williamr@2
    22
{
williamr@2
    23
    return p.get();
williamr@2
    24
}
williamr@2
    25
williamr@2
    26
williamr@2
    27
} // namespace boost
williamr@2
    28
williamr@2
    29
#endif // GET_POINTER_DWA20021219_HPP