Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-04-05 13:30:08


Gennadiy Rozental wrote:

>"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
>news:c4i8sj$947$1_at_sea.gmane.org...
>
>
>>Hi Alexander,
>>
>>"Alexander Nasonov" <alnsn-mycop_at_[hidden]> wrote in message
>>news:c4hmul$uuc$1_at_sea.gmane.org...
>>
>>
>>>I like the idea. However, I argue with some design decisions.
>>>The biggest problem is that it's too easy to add operator+= to any
>>>container-like class.
>>>
>>>
>>What would you prefer then?
>>
>>
>
>I also believe that providing template method for global operator += is not
>good idea.
>
>What you could do is to provide an operator += specialization for stl
>containers and support initialization in a form:
>
>init( C ) += ...
>
>as a generic solution.
>
>
>

I definitely second that.

Of course, there's an insert(c) in the library, but that works like
insert(cont) (a)(b)(c);

I would like:
insert(count) += a,b,c;

Seems much more straightforward, and doesn't overload operator += for a
containers, which I think could turn out to be dangerous.

Best,
John


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