PageRenderTime 33ms CodeModel.GetById 28ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/get_pointer.hpp

http://hadesmem.googlecode.com/
C++ Header | 33 lines | 14 code | 9 blank | 10 comment | 0 complexity | 3e2b4596dc47aeac5b29b3d29140619c MD5 | raw file
 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// In order to avoid circular dependencies with Boost.TR1
 9// we make sure that our include of <memory> doesn't try to
10// pull in the TR1 headers: that's why we use this header 
11// rather than including <memory> directly:
12# include <boost/config/no_tr1/memory.hpp>  // std::auto_ptr
13
14namespace boost { 
15
16// get_pointer(p) extracts a ->* capable pointer from p
17
18template<class T> T * get_pointer(T * p)
19{
20    return p;
21}
22
23// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
24
25template<class T> T * get_pointer(std::auto_ptr<T> const& p)
26{
27    return p.get();
28}
29
30
31} // namespace boost
32
33#endif // GET_POINTER_DWA20021219_HPP