]> git.lyx.org Git - lyx.git/blob - boost/boost/get_pointer.hpp
LFUN_ESCAPE gets ReadOnly (fix bug 1142)
[lyx.git] / boost / boost / get_pointer.hpp
1 // Copyright Peter Dimov and David Abrahams 2002. Permission to copy,
2 // use, modify, sell and distribute this software is granted provided
3 // this copyright notice appears in all copies of the source. This
4 // software is provided "as is" without express or implied warranty,
5 // and with no claim as to its suitability for any purpose.
6 #ifndef GET_POINTER_DWA20021219_HPP
7 # define GET_POINTER_DWA20021219_HPP
8
9 # include <memory>
10
11 namespace boost { 
12
13 // get_pointer(p) extracts a ->* capable pointer from p
14
15 template<class T> T * get_pointer(T * p)
16 {
17     return p;
18 }
19
20 // get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
21
22 template<class T> T * get_pointer(std::auto_ptr<T> const& p)
23 {
24     return p.get();
25 }
26
27
28 } // namespace boost
29
30 #endif // GET_POINTER_DWA20021219_HPP