Revert accidental check-in.  These changes are probably good, but premature at this point.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174625 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__split_buffer b/include/__split_buffer
index d498b21..e0aa13b 100644
--- a/include/__split_buffer
+++ b/include/__split_buffer
@@ -290,7 +290,7 @@
 __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
 {
     while (__begin_ != __new_begin)
-        __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(__begin_++));
+        __alloc_traits::destroy(__alloc(), __begin_++);
 }
 
 template <class _Tp, class _Allocator>
@@ -307,7 +307,7 @@
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
 {
     while (__new_last != __end_)
-        __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__end_));
+        __alloc_traits::destroy(__alloc(), --__end_);
 }
 
 template <class _Tp, class _Allocator>
diff --git a/include/functional b/include/functional
index 9837a18..3bee1ed 100644
--- a/include/functional
+++ b/include/functional
@@ -465,10 +465,6 @@
 #include <memory>
 #include <tuple>
 
-#if __OBJC__
-#  include <Foundation/NSObject.h>
-#endif
-
 #include <__functional_base>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -2024,26 +2020,6 @@
     }
 };
 
-#if __OBJC__
-
-template <>
-struct _LIBCPP_VISIBLE hash<id>
-    : public unary_function<id, size_t>
-{
-    _LIBCPP_INLINE_VISIBILITY
-    size_t operator()(id __v) const _NOEXCEPT {return [__v hash];}
-};
-
-template <>
-struct _LIBCPP_VISIBLE equal_to<id>
-    : public binary_function<id, id, bool>
-{
-    _LIBCPP_INLINE_VISIBILITY bool operator()(id __x, id __y) const
-        {return __x == __y || [__x isEqual: __y];}
-};
-
-#endif  //  __OBJC__
-
 // struct hash<T*> in <memory>
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/include/string b/include/string
index c99eaea..1a70467 100644
--- a/include/string
+++ b/include/string
@@ -2067,13 +2067,10 @@
     pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);
     __invalidate_all_iterators();
     if (__n_copy != 0)
-        traits_type::copy(_VSTD::__to_raw_pointer(__p),
-                          _VSTD::__to_raw_pointer(__old_p), __n_copy);
+        traits_type::copy(__p, __old_p, __n_copy);
     size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;
     if (__sec_cp_sz != 0)
-        traits_type::copy(_VSTD::__to_raw_pointer(__p + __n_copy + __n_add),
-                          _VSTD::__to_raw_pointer(__old_p + __n_copy + __n_del),
-                          __sec_cp_sz);
+        traits_type::copy(__p + __n_copy + __n_add, __old_p + __n_copy + __n_del, __sec_cp_sz);
     if (__old_cap+1 != __min_cap)
         __alloc_traits::deallocate(__alloc(), __old_p, __old_cap+1);
     __set_long_pointer(__p);
@@ -2306,7 +2303,7 @@
         if (__cap - __sz < __n)
             __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
         pointer __p = __get_pointer();
-        traits_type::assign(_VSTD::__to_raw_pointer(__p + __sz), __n, __c);
+        traits_type::assign(__p + __sz, __n, __c);
         __sz += __n;
         __set_size(__sz);
         traits_type::assign(__p[__sz], value_type());
diff --git a/include/vector b/include/vector
index f4a41d6..876b7e5 100644
--- a/include/vector
+++ b/include/vector
@@ -440,7 +440,7 @@
 __vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, false_type) _NOEXCEPT
 {
     while (__new_last != __end_)
-        __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__end_));
+        __alloc_traits::destroy(__alloc(), const_cast<pointer>(--__end_));
 }
 
 template <class _Tp, class _Allocator>
@@ -448,7 +448,7 @@
 void
 __vector_base<_Tp, _Allocator>::__destruct_at_end(const_pointer __new_last, true_type) _NOEXCEPT
 {
-    __end_ = static_cast<pointer>(__new_last);
+    __end_ = const_cast<pointer>(__new_last);
 }
 
 template <class _Tp, class _Allocator>
@@ -1550,7 +1550,7 @@
         "vector::erase(iterator) called with an iterator not"
         " referring to this vector");
 #endif
-    pointer __p = this->__begin_ + (__position - cbegin());
+    pointer __p = const_cast<pointer>(&*__position);
     iterator __r = __make_iter(__p);
     this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
     return __r;