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

/Src/Dependencies/Boost/boost/pointer_cast.hpp

http://hadesmem.googlecode.com/
C++ Header | 45 lines | 25 code | 8 blank | 12 comment | 0 complexity | 11a9cb620924b6eb75791f1e5a0f149d MD5 | raw file
 1//////////////////////////////////////////////////////////////////////////////
 2//
 3// (C) Copyright Ion Gaztanaga 2005. 
 4// Distributed under the Boost Software License, Version 1.0. 
 5// (See accompanying file LICENSE_1_0.txt or copy at 
 6//  http://www.boost.org/LICENSE_1_0.txt)
 7//
 8//////////////////////////////////////////////////////////////////////////////
 9
10#ifndef BOOST_POINTER_CAST_HPP
11#define BOOST_POINTER_CAST_HPP
12
13namespace boost { 
14
15//static_pointer_cast overload for raw pointers
16template<class T, class U>
17inline T* static_pointer_cast(U *ptr)
18{  
19   return static_cast<T*>(ptr);
20}
21
22//dynamic_pointer_cast overload for raw pointers
23template<class T, class U>
24inline T* dynamic_pointer_cast(U *ptr)
25{  
26   return dynamic_cast<T*>(ptr);
27}
28
29//const_pointer_cast overload for raw pointers
30template<class T, class U>
31inline T* const_pointer_cast(U *ptr)
32{  
33   return const_cast<T*>(ptr);
34}
35
36//reinterpret_pointer_cast overload for raw pointers
37template<class T, class U>
38inline T* reinterpret_pointer_cast(U *ptr)
39{  
40   return reinterpret_cast<T*>(ptr);
41}
42
43} // namespace boost
44
45#endif   //BOOST_POINTER_CAST_HPP