Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-11-29 13:18:00


From: "Bill Seymour" <bill-at-the-office_at_[hidden]>
> Peter Dimov wrote:
> >
> > ... every programmer needs to realize, sooner or later,
> > that when the specification of type X says that ++x may
> > return void, then it really may return void ...
> >
>
> In accordance with what I've heard called the "principle
> of least surprise," isn't it important that overloaded
> operators do the same kinds of things that they do for
> built-in types?

No. It is common to introduce types that support only some
of the available operations on built-in types. Think of
iterators. I find ++ and -- to be the most natural C++
expression of the counter concept.

Anyway, it's Peter's contribution, and I trust his
udgement.


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