[Effective-cpp] Item 1: Uses and Abuses of vector
Mark Radford
mark at twonine.co.uk
Sun Oct 31 16:27:49 EST 2004
On Wed, 27 Oct 2004, at 16:11:20, Paul Grenyer <paul at paulgrenyer.co.uk>
writes
>> This isn't a problem with naming your own function objects - the problem
>> is that it's just hard to come up with meaningful names for things in
>> all but the simplest situations.
>
>That's the same thing isn't it?
I was just pointing out that the problem of finding meaningful
identifier names is wider in scope than the naming of function objects.
>> for_each(c.begin(), c.end,write
>>
>> This simply tells you that each element in the range is being written to
>> cout,
>
>It does? How? Write could be writing to anywhere. A file, a database, a log,
>etc. Therefore in this instance, it would still mean going off to find the
>write functor to see what is actually happening.
Surely the "cout" in parenthases following "write" gives a clear hint at
the destination of the write.
Having said that, the statement I posted was:
for_each(c.begin(), c.end(), write(cout));
But you seem to have removed the salient part in your quote.
- Mark.
--
Mark Radford
twoNine Computer Services Ltd - Software Development & Consultancy
http://www.twonine.co.uk
More information about the Effective-cpp
mailing list