From 3677727633594389722
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,eaf633a917dfd8af
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-11-10 02:38:09 PST
Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: drpizza@anti-flash.co.uk ("DrPizza")
Newsgroups: comp.std.c++
Subject: Re: Passing functor-parameters in for_each() and transform()
Date: Mon, 10 Nov 2003 10:38:08 +0000 (UTC)
Organization: Posted via Supernews, http://www.supernews.com
Lines: 36
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <vqu0506n5vle64@corp.supernews.com>
References: <bo8jui$19aso0$1@ID-79865.news.uni-berlin.de>
X-Trace: mail2news.demon.co.uk 1068460688 15237 10.0.0.1 (10 Nov 2003 10:38:08 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 10 Nov 2003 10:38:08 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 1AJ9Qs-0003xK-00
	for mail2news@news.news.demon.net; Mon, 10 Nov 2003 10:38:07 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id VAA27463; Mon, 10 Nov 2003 21:38:03 +1100 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Spam-Status: No, hits=-4.9 required=5.0
	tests=AWL,BAYES_10,PRIORITY_NO_NAME,QUOTED_EMAIL_TEXT,REFERENCES
	version=2.55
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
Xref: archiver1.google.com comp.std.c++:408

""Alex Vinokur"" <alexvn@bigfoot.com> wrote in message
news:bo8jui$19aso0$1@ID-79865.news.uni-berlin.de...
>
> Functor-parameters in the for_each() and transform() algorithms are passed
by value.
>
> Might it make sense to have also algorithms for_each2() and transform2()
>   which pass Functor-parameters by non-const reference?
>
>
> Here is some program which demonstrates probable necessity
>   in such forms of for_each() and transform().

It is right and proper that transform() doesn't take it by reference; that's
not what transform is for.

for_each appears to have no need to take it by reference because it returns a
copy.


-- 
Now Playing:  Mark'Oh - Fade To Grey (Original Radio Verison)


char a[99999],*p=a;main(c,V)char**V;{char*v=c>0?1[V]:V;if(c)for(;(c=*v)&&93^
c;p+=!(62^c)-!(60^c),*p+=!(43^c)-!(45^c),44^c||read(0,p,1),46^c||putchar(*p)
,91^c||(v=*p?main(-1,v+1),v-1:main(0,v)),++v);else for(;c+=!(91^*v)-!(93^*v)
;++v);return v;} /* drpizza@battleaxe.net    brainf*** program as argv[1] */


---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]



