Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2004-08-28 02:55:15


On 8/27/04 12:42 PM, "Rob Stewart" <stewart_at_[hidden]> wrote:

> From: "Jonathan Turkanis" <technews_at_[hidden]>
>> "Rob Stewart" <stewart_at_[hidden]> wrote in message
>> news:200408262114.i7QLEOP14442_at_lawrencewelk.systems.susq.com...
>>> From: "Jonathan Turkanis" <technews_at_[hidden]>
[SNIP]
>>>> - multi_newer: How often do you need to write multiple copies of a
>>>> character to a stream? And isn't it easy to do so already? The name is
>>>> bad, too. I vote to reject.
>>>
>>> I'm sure one doesn't need to write multiple copies of a character
>>> to a stream too often, but why reject this manipulator on the
>>> grounds that it isn't needed very often?
>>
>> Because it clutters up the library, making it harder for people to find the
>> parts they really need.
>>
>> Also, the straightforward way of writing a sequence of repeated characters to
>> a stream makes it immediately obvious what is being done, whereas
>> programmers looking at code written by someone else can't be expected to know
>> what multi_newer does. If a component fills an important need, it's
>> reasonable to expect people to learn about it if they want to understand your
>> code -- otherwise, I don't see the point.
>
> Daryle can build his own defense on why he included multi_newer.
> It is cleaner than inserting the same character multiple times.
> You're right that it's not an improvement over inserting
> std::string('c', n). The name, of course, is a problem, too.
[TRUNCATE]

The idea for "multi_newer" just popped into my head. The string solution is
worse because it forces an extra memory allocation.

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk