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 |
|
---|
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
|
---|
Note: See
TracBrowser
for help on using the repository browser.