home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_06
/
9n06058b
< prev
next >
Wrap
Text File
|
1991-02-25
|
1KB
|
52 lines
//
// class LongThing -- a long thing derived from
// class Thing.
//
// Version 1.01 -- 2/25/91
//
// Michael Kelly -- Author
//
#include <stdio.h>
#include "th_long.hpp"
void LongThing::print()
{
printf("%ld\n", (long)*this);
}
LongThing::operator ==(Thing &some_thing)
{
return ( type() == some_thing.type() ) ?
( *((long *)ptr()) == *((long *)some_thing.ptr()) ) : 0;
}
LongThing::operator !=(Thing &some_thing)
{
return ( type() == some_thing.type() ) ?
( *((long *)ptr()) != *((long *)some_thing.ptr()) ) : 0;
}
LongThing::operator < (Thing &some_thing)
{
return ( type() == some_thing.type() ) ?
( *((long *)ptr()) < *((long *)some_thing.ptr()) ) : 0;
}
LongThing::operator <=(Thing &some_thing)
{
return ( type() == some_thing.type() ) ?
( *((long *)ptr()) <= *((long *)some_thing.ptr()) ) : 0;
}
LongThing::operator > (Thing &some_thing)
{
return ( type() == some_thing.type() ) ?
( *((long *)ptr()) > *((long *)some_thing.ptr()) ) : 0;
}
LongThing::operator >=(Thing &some_thing)
{
return ( type() == some_thing.type() ) ?
( *((long *)ptr()) >= *((long *)some_thing.ptr()) ) : 0;
}