[cfe-commits] [libcxx] r148508 - /libcxx/trunk/include/memory

Howard Hinnant hhinnant at apple.com
Thu Jan 19 15:15:22 PST 2012


Author: hhinnant
Date: Thu Jan 19 17:15:22 2012
New Revision: 148508

URL: http://llvm.org/viewvc/llvm-project?rev=148508&view=rev
Log:
Enable full functionality of shared_ptr<const void> by adding allocator<const void>.  Credit to John Hurley for discovering this bug.

Modified:
    libcxx/trunk/include/memory

Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=148508&r1=148507&r2=148508&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Thu Jan 19 17:15:22 2012
@@ -672,6 +672,17 @@
     template <class _Up> struct rebind {typedef allocator<_Up> other;};
 };
 
+template <>
+class _LIBCPP_VISIBLE allocator<const void>
+{
+public:
+    typedef const void*       pointer;
+    typedef const void*       const_pointer;
+    typedef const void        value_type;
+
+    template <class _Up> struct rebind {typedef allocator<_Up> other;};
+};
+
 // pointer_traits
 
 template <class _Tp>





More information about the cfe-commits mailing list