Awali
Another Weighted Automata library
empty.hh
Go to the documentation of this file.
1 // This file is part of Awali.
2 // Copyright 2016-2021 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  // For unordered containers.
39  inline
41  {
42  return true;
43  }
44  }
45 }//end of ns awali::stc
46 
47 namespace std
48 {
49  // For unordered containers.
50  template <>
51  struct hash<awali::sttc::empty_t>
52  {
54  {
55  return 0;
56  }
57  };
58 
59  std::ostream& operator<< (std::ostream& o, const awali::sttc::empty_t& e) {
60  return o;
61  }
62 }
63 
64 
65 #endif // !AWALI_EMPTY_HH
bool operator<(empty_t, empty_t)
Definition: empty.hh:33
bool operator==(empty_t, empty_t)
Definition: empty.hh:40
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:53