Re: [PATCH] Add non-const overload of std::string::data()

2016-07-13 Thread Jonathan Wakely
On 13/07/16 15:59 +0100, Jonathan Wakely wrote: On 13/07/16 12:12 +0100, Jonathan Wakely wrote: Also fix confusion between pointer and _CharT*, so that allocators with fancy pointers work correctly. The _M_data() function returns pointer, but we were using it where _CharT* was required. This in

Re: [PATCH] Add non-const overload of std::string::data()

2016-07-13 Thread Jonathan Wakely
On 13/07/16 12:12 +0100, Jonathan Wakely wrote: Also fix confusion between pointer and _CharT*, so that allocators with fancy pointers work correctly. The _M_data() function returns pointer, but we were using it where _CharT* was required. This introduces a new _M_c_str() function which returns

[PATCH] Add non-const overload of std::string::data()

2016-07-13 Thread Jonathan Wakely
Also fix confusion between pointer and _CharT*, so that allocators with fancy pointers work correctly. The _M_data() function returns pointer, but we were using it where _CharT* was required. This introduces a new _M_c_str() function which returns a _CharT* instead, and uses that for c_str() and