Implement P0272R1: Give 'std::string' a non-const '.data()' member function
llvm-svn: 262931
diff --git a/libcxx/include/string b/libcxx/include/string
index 004dc3d..a453779 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -225,6 +225,7 @@
 
     const value_type* c_str() const noexcept;
     const value_type* data() const noexcept;
+          value_type* data()       noexcept;   // C++17
 
     allocator_type get_allocator() const noexcept;
 
@@ -1659,6 +1660,10 @@
     const value_type* c_str() const _NOEXCEPT {return data();}
     _LIBCPP_INLINE_VISIBILITY
     const value_type* data() const _NOEXCEPT  {return _VSTD::__to_raw_pointer(__get_pointer());}
+#if _LIBCPP_STD_VER > 14
+    _LIBCPP_INLINE_VISIBILITY
+    value_type* data()             _NOEXCEPT  {return _VSTD::__to_raw_pointer(__get_pointer());}
+#endif
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT {return __alloc();}