aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2011-06-05 20:28:38 +0000
committerJonathan Wakely <jwakely.gcc@gmail.com>2011-06-05 20:28:38 +0000
commitb94b7ed44f89c3c0747990b8168ded64165c57af (patch)
tree419f7baaabe7c5964b7af4ecfda23880d0e4ab02 /libstdc++-v3/include/ext
parent7b2e18251c8be6ffd4c8a2d14cc7335ac9d58f09 (diff)
2011-06-05 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/ptr_traits.h (pointer_traits): Fix typos. * include/ext/pointer.h (pointer_traits): Add partial specialization for _Pointer_adapter. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@174661 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext')
-rw-r--r--libstdc++-v3/include/ext/pointer.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/libstdc++-v3/include/ext/pointer.h b/libstdc++-v3/include/ext/pointer.h
index 158ae52e3b8..2dc1c398d1c 100644
--- a/libstdc++-v3/include/ext/pointer.h
+++ b/libstdc++-v3/include/ext/pointer.h
@@ -42,6 +42,9 @@
#include <bits/stl_iterator_base_types.h>
#include <ext/cast.h>
#include <ext/type_traits.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <bits/ptr_traits.h>
+#endif
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
@@ -567,4 +570,40 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ template<typename _Storage_policy>
+ struct pointer_traits<__gnu_cxx::_Pointer_adapter<_Storage_policy>>
+ {
+ /// The pointer type
+ typedef __gnu_cxx::_Pointer_adapter<_Storage_policy> pointer;
+ /// The type pointed to
+ typedef typename pointer::element_type element_type;
+ /// Type used to represent the difference between two pointers
+ typedef typename pointer::difference_type difference_type;
+
+ /* TODO: replace __rebind<U> with alias template rebind<U> */
+ /*
+ template<typename _Up>
+ using rebind<_Up> = typename __gnu_cxx::_Pointer_adapter<
+ typename pointer_traits<_Storage_policy>::rebind<_Up>>
+ */
+ template<typename _Up>
+ class __rebind
+ {
+ typedef pointer_traits<_Storage_policy> _Policy_traits;
+ typedef typename _Policy_traits::template __rebind<_Up>::__type
+ _Rebound_policy;
+ public:
+ typedef typename __gnu_cxx::_Pointer_adapter<_Rebound_policy> __type;
+ };
+ };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+#endif
+
#endif // _POINTER_H