head     1.1;
branch   ;
access   ;
symbols  ;
locks    ; strict;
comment  @@;


1.1
date     92.06.12.16.20.37;  author thoth;  state Exp;
branches ;
next     ;


desc
@prototype for the Point helper class
@



1.1
log
@Initial revision
@
text
@//
// helper for Point::operator[]
//

class Point;
class Coord;

class PointSub {
    Coord	*victim;
public:
    PointSub(Point *, int);
    PointSub(const PointSub&);
    ~PointSub();
    Coord operator=(Coord);
    operator Coord(){ return *victim; }
};


PointSub::PointSub(Point *p, int index)
{
    victim = p->coordinates+index;
}

PointSub::PointSub(const PointSub &ps)
{
    victim = ps.victim;
}

PointSub::~PointSub()
{
}

Coord PointSub::operator=(Coord c)
{

    /* this will puke if someone assigns the wrong type */
    *victim = c.promote(victim->type());
}

//
//
@
