From 857573192985295698
X-Google-Thread: f78e5,516d54c6ff652958
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: dave@boost-consulting.com (David Abrahams)
Newsgroups: comp.std.c++
Subject: Re: "moveable data type" in comparison with "r-value reference"
Date: Thu, 12 Apr 2007 04:56:39 GMT
Lines: 42
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <87k5wi5kby.fsf@grogan.peloton>
References: <etsb2u$up$1@aioe.org> <BadTh.333$IZ2.182@newsfe2-gui.ntli.net>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.demon.co.uk 1176353805 23626 158.152.254.254 (12 Apr 2007 04:56:45 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 12 Apr 2007 04:56:45 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)
X-DMCA-Complaints-To: abuse@rcn.net
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Cancel-Lock: sha1:aTnlAqamQqjaaINLqeQnCgkeuvs=
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.8+Sun/8.13.8/Submit) id l3C4udfg007769;
	Thu, 12 Apr 2007 14:56:39 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: Wed, 11 Apr 2007 22:43:13 -0500
X-Delivered-To: std-c++@mailman.ucar.edu
X-Postfilter: 1.3.34
X-Authentication-Warning: serv4.gc.dca.giganews.com: news set sender to poster@giganews.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:8434


on Wed Apr 11 2007, Richard Smith <richard-AT-ex-parrot.com> wrote:

> Grizlyk wrote:
>
>> I will try to continue to show differences between "moveable data type" and
>> "r-value reference", in order to project, that even simplest kind of
>> algorithms with moveable data type could not be implemented with the help of
>> "r-value reference".
>
> I dispute this.  Let me demonstrate.
>
> Let's invent a trivially simple algorithm that might gain from a
> movable data type

It's good of you to go to the trouble, but Howard has already
implemented an entire standard library using rvalue references
wherever possible, and done the timing tests to show that it produces
dramatic improvements over the existing one when used with types that
are move-enabled.  So there's an existence proof that even nontrivial
and complex algorithms can be implemented using rvalue references such
that they're efficient with moveable data types.

And one point you make in your post, but which I think Grizlyk keeps
missing: using rvalue references one can write the algorithms *once*
such that they work as efficiently as possible for both moveable and
non-moveable data types.  It isn't necessary for algorithms to
distinguish moveable types from non-moveable data types.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Don't Miss BoostCon 2007! ==> http://www.boostcon.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



