Move boost/intrusive to senf/boost_intrusive
[senf.git] / senf / boost_intrusive / detail / pointer_type.hpp
diff --git a/senf/boost_intrusive/detail/pointer_type.hpp b/senf/boost_intrusive/detail/pointer_type.hpp
new file mode 100644 (file)
index 0000000..065250f
--- /dev/null
@@ -0,0 +1,54 @@
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// (C) Copyright Ion GaztaƱaga 2006. Distributed under the Boost\r
+// Software License, Version 1.0. (See accompanying file\r
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+//\r
+// See http://www.boost.org/libs/intrusive for documentation.\r
+//\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef BOOST_INTRUSIVE_POINTER_TYPE_HPP\r
+#define BOOST_INTRUSIVE_POINTER_TYPE_HPP\r
+\r
+#include "config_begin.hpp"\r
+\r
+namespace boost {\r
+namespace intrusive {\r
+namespace detail  {\r
+\r
+struct two {char _[2];};\r
+\r
+namespace pointer_type_imp\r
+{\r
+\r
+template <class U> static two  test(...);\r
+template <class U> static char test(typename U::pointer* = 0);\r
+\r
+}  //namespace pointer_type_imp\r
+\r
+template <class T>\r
+struct has_pointer_type\r
+{\r
+    static const bool value = sizeof(pointer_type_imp::test<T>(0)) == 1;\r
+};\r
+\r
+template <class T, class A, bool = has_pointer_type<A>::value>\r
+struct pointer_type\r
+{\r
+    typedef typename A::pointer type;\r
+};\r
+\r
+template <class T, class A>\r
+struct pointer_type<T, A, false>\r
+{\r
+    typedef T* type;\r
+};\r
+\r
+}  //namespace detail\r
+}  //namespace intrusive\r
+} // namespace boost\r
+\r
+#include "config_end.hpp"\r
+\r
+#endif   //#ifndef BOOST_INTRUSIVE_POINTER_TYPE_HPP\r