author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
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 |