This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [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()
- From: "=?gb18030?b?98jTsMql0/I=?=" <805600352 at qq dot com>
- To: "=?gb18030?b?bGlic3RkYysr?=" <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 8 Jan 2015 21:34:29 +0800
- Subject: Re: [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()
- Authentication-results: sourceware.org; auth=none
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.