File: boolean.h

package info (click to toggle)
newmat 1.10.4-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,908 kB
  • sloc: cpp: 31,314; makefile: 56
file content (40 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//$$ boolean.h                       bool class

// This is for compilers that do not have bool automatically defined

#ifndef bool_LIB
#define bool_LIB 0

#ifdef use_namespace
namespace RBD_COMMON {
#endif


class bool
{
	int value;
public:
	bool(const int b) { value = b ? 1 : 0; }
	bool(const void* b) { value = b ? 1 : 0; }
	bool() {}
	operator int() const { return value; }
	int operator!() const { return !value; }
};


const bool true = 1;
const bool false = 0;



// version for some older versions of gnu g++
//#define false 0
//#define true 1

#ifdef use_namespace
}
#endif



#endif