|
www.davinpearson.com
New Zealanders making it harder to hate computers
|
|
bool.hh
#ifndef ALREADY_INCLUDED_RCGCS_BOOL_HH
#define ALREADY_INCLUDED_RCGCS_BOOL_HH
class Bool : public Ref_Count
{
private:
explicit Bool(bool v) : Ref_Count(DCODE_BOOL)
{
this->v = v;
}
public:
bool v;
static Bool* ctor(bool b)
{
return new Bool(b);
}
static Bool* ctor()
{
return new Bool(0);
}
friend bool operator == (const Bool& b1, const Bool& b2)
{
if ((&b1 == null) && (&b2 == null)) {
return true;
} else if ((&b1 == null) || (&b2 == null)) {
return false;
} else {
return b1.v == b2.v;
}
}
friend Writer& operator << (Writer& w, const Bool& b)
{
w << (b.v? "true" : "false");
return w;
}
};
#endif /* ALREADY_INCLUDED_RCGCS_BOOL_HH */
Main Menu
Research Projects
Photo Album
Curriculum Vitae
Greatest Artists
Email Address
Computer Games
Web Design
Java Tutorials
Other Links
Debugging Macros
String Class I
Linked List System I
Java for C Programmers
Naming Convention
String Class II
How I use m4
Strings III
Symmetrical I/O
Linked List System II
Run-Time Type Info
Virtual Methods
An Array System
Science & Religion
Submodes
Nested Packages
Memory Leaks
Garbage Collection
Internet & Poverty
What is Knowledge?
Limits of Evolution
Emacs Additions
Function Plotter
Please report any broken links to the webperson
Last modified: Wed Jun 13 18:47:32 NZST 2007
© Copyright 1999-2007 Davin Pearson.