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