OpenLexocad  27.0
Int.h
Go to the documentation of this file.
1 #pragma once
2 #pragma warning(disable : 4251)
3 
4 #include <Base/base_defines.h>
5 
6 namespace Base
7 {
9 {
11  // //
12  // --------------------- BEGIN API --------------------- //
13  // //
14  // ATTENTION: DO NOT CHANGE ANY SIGNATURES IN THE API ! //
15  // //
17 
18  int value;
19 
20  // Semi-regular
21  explicit Int(int x) : value(x) {}
22  explicit Int(const Int& x) : value(x.value) {}
23  Int() {}
24  ~Int() {}
25  Int& operator=(const Int& x)
26  {
27  value = x.value;
28  return *this;
29  }
30 
31  // Regular
32  friend bool operator==(const Int& x, const Int& y) { return x.value == y.value; }
33 
34  friend bool operator!=(const Int& x, const Int& y) { return !(x == y); }
35 
36  // TotallyOrdered
37  friend bool operator<(const Int& x, const Int& y) { return x < y; }
38 
39  friend bool operator>(const Int& x, const Int& y) { return y < x; }
40 
41  friend bool operator<=(const Int& x, const Int& y) { return !(y < x); }
42 
43  friend bool operator>=(const Int& x, const Int& y) { return !(x < y); }
44 
45 
47  // //
48  // ---------------------- END API ---------------------- //
49  // //
51 };
52 } // namespace Base
friend bool operator>(const Int &x, const Int &y)
Definition: Int.h:39
friend bool operator<(const Int &x, const Int &y)
Definition: Int.h:37
~Int()
Definition: Int.h:24
Int()
Definition: Int.h:23
#define BASE_EXPORT
Definition: base_defines.h:12
friend bool operator<=(const Int &x, const Int &y)
Definition: Int.h:41
Int(const Int &x)
Definition: Int.h:22
Int & operator=(const Int &x)
Definition: Int.h:25
int value
Definition: Int.h:18
Int(int x)
Definition: Int.h:21
friend bool operator!=(const Int &x, const Int &y)
Definition: Int.h:34
Definition: AbstractXMLReader.h:8
friend bool operator>=(const Int &x, const Int &y)
Definition: Int.h:43
friend bool operator==(const Int &x, const Int &y)
Definition: Int.h:32
Definition: Int.h:8