🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3039

Re: More on the operations on the entire container

#3039
From: David Byrden
Date: Thu, 18 Jan 1996 13:23
31 lines
1491 bytes
Genie;

>> Operations on the whole container are (as the threads flashing here
>> sometimes show) the most common kind of range operations in a program
>> using the STL. Hence, it is generally felt that the current idiom for
>> this    Iterator i = find(c.begin(), c.end(), x);  is verbose,
>>  cumbersome and error-prone. 


>>   So, what do you think?    

I think it's 6 months too late to propose changes to the standard!  :)

I keep a little library of template functions;

 
template< class Container, class Functor > 
 void  for_contents(  Container& c, Functor  f  )
 {
    for_each(  c.begin(), c.end(), f  ) ;
 }
 

Problem solved?


             David
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <4dknla$dap@news.bridge.net>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <AFyED_m0h3@qsar.chem.msu.su>

Show Full Headers
Complete Article Headers
From: David Byrden <100101.2547@compuserve.com>
Message-ID: <4dknla$dap@news.bridge.net>
X-Original-Date: 18 Jan 1996 06:00:10 GMT
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 18 Jan 96 13:23:26 GMT
Approved: fjh@cs.mu.oz.au
Newsgroups: comp.std.c++
Subject: Re: More on the operations on the entire container
Organization: self-employed
References: <AFyED_m0h3@qsar.chem.msu.su>
X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMP5J3eEDnX0m9pzZAQE09QF+I1qXz5SCkf/IHqJroX4/Ub2d2wrb5WoX
 eccoprOVv0xxOdvWtQu2bu8plq9dKPqm
 =wMkc