Boost logo

Boost :

From: Bjarne Stroustrup (bs_at_[hidden])
Date: 2001-07-19 15:14:01

"Fernando Cacciola" <fcacciola_at_[hidden]> writes:
> In order to introduce this proposal let's consider the following situations:
> =======
> struct image
> {
> ...
> int get_pixel( int x, int y) const ;
> ...
> } ;
> How should we deal with the case of x,y being outside the image?
> Unfortunately, it might be the case that every possible integer value is a
> valid pixel color, so no value can be used to signal that there is no pixel
> at that position.
> Assume that the function should not throw an exception.

Why/when is that a good assumption?

When used systematically, the "stateful" technique simulates on of the
techniques for implementing simple exceptions.

        - Bjarne
Bjarne Stroustrup,

Boost list run by bdawes at, gregod at, cpdaniel at, john at