Move include files in debian packge into 'senf' subdirectory
[senf.git] / boost / intrusive / detail / pointer_type.hpp
1 /////////////////////////////////////////////////////////////////////////////\r
2 //\r
3 // (C) Copyright Ion GaztaƱaga 2006. Distributed under the Boost\r
4 // Software License, Version 1.0. (See accompanying file\r
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
6 //\r
7 // See http://www.boost.org/libs/intrusive for documentation.\r
8 //\r
9 /////////////////////////////////////////////////////////////////////////////\r
10 \r
11 #ifndef BOOST_INTRUSIVE_POINTER_TYPE_HPP\r
12 #define BOOST_INTRUSIVE_POINTER_TYPE_HPP\r
13 \r
14 #include "config_begin.hpp"\r
15 \r
16 namespace boost {\r
17 namespace intrusive {\r
18 namespace detail  {\r
19 \r
20 struct two {char _[2];};\r
21 \r
22 namespace pointer_type_imp\r
23 {\r
24 \r
25 template <class U> static two  test(...);\r
26 template <class U> static char test(typename U::pointer* = 0);\r
27 \r
28 }  //namespace pointer_type_imp\r
29 \r
30 template <class T>\r
31 struct has_pointer_type\r
32 {\r
33     static const bool value = sizeof(pointer_type_imp::test<T>(0)) == 1;\r
34 };\r
35 \r
36 template <class T, class A, bool = has_pointer_type<A>::value>\r
37 struct pointer_type\r
38 {\r
39     typedef typename A::pointer type;\r
40 };\r
41 \r
42 template <class T, class A>\r
43 struct pointer_type<T, A, false>\r
44 {\r
45     typedef T* type;\r
46 };\r
47 \r
48 }  //namespace detail\r
49 }  //namespace intrusive\r
50 } // namespace boost\r
51 \r
52 #include "config_end.hpp"\r
53 \r
54 #endif   //#ifndef BOOST_INTRUSIVE_POINTER_TYPE_HPP\r