Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/get_pointer.hpp @ 46

Last change on this file since 46 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 658 bytes
Line 
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
10namespace boost { 
11
12// get_pointer(p) extracts a ->* capable pointer from p
13
14template<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
21template<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
Note: See TracBrowser for help on using the repository browser.