Awali
Another Weighted Automata library
empty.hh
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3 //
4 // Awali is a free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef AWALI_EMPTY_HH
18 # define AWALI_EMPTY_HH
19 
20 # include <functional> // std::hash
21 # include <iostream>
22 
23 namespace awali {
24  namespace sttc {
25 
27  struct empty_t
28  {};
29 
30  // So that we can make a map with empty_t as key, for
31  // mutable_automaton's entries.
32  inline
34  {
35  return false;
36  }
37 
38  inline
40  {
41  return true;
42  }
43 
44  // So that we can make a map with empty_t as key, for
45  // mutable_automaton's entries.
46  inline
48  {
49  return false;
50  }
51 
52  inline
54  {
55  return true;
56  }
57 
58  // For unordered containers.
59  inline
61  {
62  return true;
63  }
64 
65  inline
67  {
68  return false;
69  }
70 
71  inline
73  {
74  return e;
75  }
76  }
77 }//end of ns awali::stc
78 
79 namespace std
80 {
81  // For unordered containers.
82  template <>
83  struct hash<awali::sttc::empty_t>
84  {
86  {
87  return 0;
88  }
89  };
90 
91  std::ostream& operator<< (std::ostream& o, const awali::sttc::empty_t&) {
92  return o;
93  }
94 }
95 
96 
97 #endif // !AWALI_EMPTY_HH
bool operator<(empty_t, empty_t)
Definition: empty.hh:33
empty_t & operator--(empty_t &e)
Definition: empty.hh:72
bool operator!=(empty_t, empty_t)
Definition: empty.hh:66
bool operator>(empty_t, empty_t)
Definition: empty.hh:47
bool operator>=(empty_t, empty_t)
Definition: empty.hh:53
bool operator<=(empty_t, empty_t)
Definition: empty.hh:39
bool operator==(empty_t, empty_t)
Definition: empty.hh:60
Empty labels, for LAO.
Definition: empty.hh:28
Main namespace of Awali.
Definition: ato.hh:22
size_t operator()(awali::sttc::empty_t) const
Definition: empty.hh:85