Bug 51981 - Missing uninitialized_move() implementation?
Summary: Missing uninitialized_move() implementation?
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.7.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 16:41 UTC by Aliaksandr Valialkin
Modified: 2012-01-25 15:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aliaksandr Valialkin 2012-01-24 16:41:39 UTC
It's interesting to know why uninitialized_copy()'s counterpart - uninitialized_move() - is missing in http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/bits/stl_uninitialized.h?revision=177542&view=markup ?

See boost's docs for details - http://www.boost.org/doc/libs/1_48_0/doc/html/boost/uninitialized_move.html .
Comment 1 Jonathan Wakely 2012-01-24 16:46:12 UTC
Because it's non-standard
Comment 2 Marc Glisse 2012-01-24 23:01:09 UTC
It looks like it would be equivalent to uninitialized_copy with make_move_iterator, not so useful then.
Comment 3 Aliaksandr Valialkin 2012-01-25 14:38:50 UTC
(In reply to comment #2)
> It looks like it would be equivalent to uninitialized_copy with
> make_move_iterator, not so useful then.

This makes sense, but not so obvious for novices in C++11.

If continuing in this vein, then std::move() can be substituted by std::copy() with input iterator wrapped into make_move_iterator(). Then std::move() is not so useful :)
Comment 4 Paolo Carlini 2012-01-25 15:00:26 UTC
Marc gave you an important practical advice and rationale, but as matter of principle is more important that the function is *non standard*, really if you use that you are *outside* the new C++11 Standard, is that clear? And the name isn't uglified thus even if we wanted we could not add it and remain conforming. This issue is invalid.
Comment 5 Marc Glisse 2012-01-25 15:02:55 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > It looks like it would be equivalent to uninitialized_copy with
> > make_move_iterator, not so useful then.
> 
> This makes sense, but not so obvious for novices in C++11.

I don't think novices should use anything with "uninitialized" in the name. Notice that very few functions on iterators have a move version. vector::insert doesn't come with a move_insert counterpart.

> If continuing in this vein, then std::move() can be substituted by std::copy()
> with input iterator wrapped into make_move_iterator().

True, although there can be subtle differences for input iterators where the reference type is not a reference to the value_type (there's a DR about that).

> Then std::move() is not so useful :)

Indeed. The standard tries to keep a balance, and I guess move was considered common enough to deserve its own interface, but could easily have been removed.

Note that I don't think gcc's bugzilla is the best place for such discussions...