finitediff
m_num.h
Go to the documentation of this file.
1 /*
2 Copyright 2017 Laurent Claessens
3 contact : laurent@claessens-donadello.eu
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 
20 #ifndef __MNUM_H__094427__
21 #define __MNUM_H__094427__
22 
23 #import <iostream>
24 
34 class m_num
35 {
36  private :
37  unsigned int num;
38  public :
39  m_num(const unsigned int n); // non explicit by choice
40  explicit m_num(const int n); // I do not want -4 to enter here
41 
42  m_num operator++(); // ++i
43  m_num operator++(int); // i++
44 
45  bool operator >(const unsigned int& b) const;
46  bool operator >(const m_num& b) const;
47  bool operator >(const int& b) const;
48 
49  bool operator <(const unsigned int& b) const;
50  bool operator <(const m_num& b) const;
51  bool operator <(const int& b) const;
52 
54  operator unsigned int() const;
55 
56  void swap(m_num& other);
57 };
58 
59 
60 #endif
bool operator<(const unsigned int &b) const
Definition: m_num.cpp:73
bool operator>(const unsigned int &b) const
Definition: m_num.cpp:67
Definition: m_num.h:34
unsigned int num
Definition: m_num.h:37
m_num(const unsigned int n)
Definition: m_num.cpp:25
m_num operator++()
Definition: m_num.cpp:53
void swap(m_num &other)
Definition: m_num.cpp:39