From 8284423267391026826
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b3e3d077abe0c9b3,start
X-Google-Attributes: gidf78e5,public
From: Cristian Georgescu <Cristian.Georgescu@worldnet.att.net>
Subject: Count signature
Date: 1998/05/09
Message-ID: <6j0bmk$m0v@bgtnsc03.worldnet.att.net>#1/1
X-Deja-AN: 352011725
X-NNTP-Posting-Host: 12.68.190.197
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
Content-Type: text/plain; charset=us-ascii
Organization: AT&T WorldNet Services
Mime-Version: 1.0
Reply-To: Cristian.Georgescu@worldnet.att.net
Newsgroups: comp.std.c++
Originator: clamage@taumet


Count signature
===============

The "count" algorithm as specified by the standard returns the 
result in a parameter passed by reference; 

In C++PL 3 page 526 (18.5.3) 
the same count algorithm seems to return the result as the return value 
of the function. 

Which information is the newest?

Here is the extract from the standard:

C++ language Standard Draft
===========================

template<class InputIterator, class T, class Size>

void count(InputIterator first, InputIterator last, const T& value,

Size& n);

template<class InputIterator, class Predicate, class Size>

void count_if(InputIterator first, InputIterator last, Predicate pred,
Size& n);

Effects: Adds to n the number of iterators i in the range [ first, last)
for which the following corresponding conditions hold: *i == value, pred
(*i) == true.
Complexity: Exactly last - first applications of the corresponding
predicate.
Notes: count must store the result into a reference argument instead of
returning the result because the size type cannot be deduced from
built-in iterator types such as int*.

-- 
Cristian Georgescu
_________________________________________________
    Smiths Industries
    Aerospace & Defense Systems
    7-9 Vreeland Road,
    Florham Park, NJ 07932, USA.


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




