Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-01-05 19:00:47

> I've tried ;) But you can't do it with current interface of 'point' and may
> be this is a problem we need to solve some way. In order to restore class
> invariant you need to swap corresponding coordinates of rectangle edges
> (e.g. left and right), not whole corner points. And the only form to assign
> a new value to any point coordinates (x or y) is to write something like
> p.x( new_value ) - this is not a form with which std::swap can deal...

On second thought, it's the implementation which is the problem, not the
interface. You could store top, left, bottom, and right as separate data
members instead of storing complete points.


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