Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-04-01 18:33:35


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?

> For example, this program doesn't compile:
>
> struct not_container
> {
> typedef int value_type;
>
> template<class T>
> void operator+=(T) {}
> };
>
> #include <boost/assign/stl.hpp>
> using namespace boost::assignment;
>
> int main()
> {
> not_container v;
> v += 1, 3;
insert(v)(1)(3); // should work
> }

best regards

Thorsten


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