[Patch]New feature to all kind of stl container.vector::data_move() returns vector::data() that can be moved,just as unique_ptr::release() to unique_ptr::get()

魅影圣域 805600352@qq.com
Thu Jan 8 13:34:00 GMT 2015


Same as my original idea.
my vector<T>::data_move() can be exactly in this function form
T* data()&&;
And thanks to Marc Glisse for works on std::string.
Since it's a real nead,anyone consider my idea acceptable to libstdc++?



------------------ Original ------------------

On Thu, 8 Jan 2015, Jonathan Wakely wrote:

> On 8 January 2015 at 07:24, Marc Glisse wrote:
>
>> This should be spelled:
>> std::move(ss).str()
>
> But str() still has to return a copy. That would help if there was an
> rvalue-ref-qualified version str()&&

Yes, that's exactly my point ;-)
I was planning to write a patch after the switch to the new std::string, 
but having 2 different versions of string in parallel means I am wary of 
touching anything related.


More information about the Libstdc++ mailing list