diff --git a/src/ltlast/formula.hh b/src/ltlast/formula.hh
index 359bfbf2a..943f7ac3b 100644
--- a/src/ltlast/formula.hh
+++ b/src/ltlast/formula.hh
@@ -501,31 +501,6 @@ namespace spot
}
};
- /// \ingroup ltl_essentials
- /// \ingroup hash_funcs
- /// \brief Hash Function for const formula*.
- ///
- /// This is meant to be used as a hash functor for
- /// \c unordered_map whose key are of type const formula*.
- ///
- /// For instance here is how one could declare
- /// a map of \c const::formula*.
- /// \code
- /// // Remember how many times each formula has been seen.
- /// std::unordered_map seen;
- /// \endcode
- struct formula_ptr_hash:
- public std::unary_function
- {
- size_t
- operator()(const formula* that) const
- {
- assert(that);
- return that->hash();
- }
- };
-
/// Print the properties of formula \a f on stream \a out.
SPOT_API
std::ostream& print_formula_props(std::ostream& out,
@@ -538,4 +513,19 @@ namespace spot
}
}
+#ifndef SWIG
+namespace std
+{
+ template <>
+ struct hash
+ {
+ size_t operator()(const spot::ltl::formula* x) const noexcept
+ {
+ assert(x);
+ return x->hash();
+ }
+ };
+}
+#endif
+
#endif // SPOT_LTLAST_FORMULA_HH
diff --git a/src/ltlvisit/contain.hh b/src/ltlvisit/contain.hh
index 579390525..ddcc0d992 100644
--- a/src/ltlvisit/contain.hh
+++ b/src/ltlvisit/contain.hh
@@ -41,8 +41,7 @@ namespace spot
typedef std::map incomp_map;
incomp_map incompatible;
};
- typedef std::unordered_map trans_map;
+ typedef std::unordered_map trans_map;
public:
/// This class uses spot::ltl_to_tgba_fm to translate LTL
/// formulae. See that function for the meaning of these options.
diff --git a/src/ltlvisit/relabel.cc b/src/ltlvisit/relabel.cc
index 5f7927cb8..73ca7f624 100644
--- a/src/ltlvisit/relabel.cc
+++ b/src/ltlvisit/relabel.cc
@@ -92,8 +92,7 @@ namespace spot
class relabeler: public clone_visitor
{
public:
- typedef std::unordered_map > map;
+ typedef std::unordered_map map;
map newname;
ap_generator* gen;
relabeling_map* oldnames;
@@ -358,8 +357,7 @@ namespace spot
{
}
};
- typedef std::unordered_map fmap_t;
+ typedef std::unordered_map fmap_t;
struct stack_entry
{
const formula* grand_parent;
diff --git a/src/tgba/taatgba.hh b/src/tgba/taatgba.hh
index e9b376ebb..f61ad0b50 100644
--- a/src/tgba/taatgba.hh
+++ b/src/tgba/taatgba.hh
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include "misc/hash.hh"
#include "ltlast/formula.hh"
#include "bdddict.hh"
@@ -144,7 +145,7 @@ namespace spot
/// A taa_tgba instance with states labeled by a given type.
/// Still an abstract class, see below.
- template
+ template
class SPOT_API taa_tgba_labelled : public taa_tgba
{
public:
@@ -236,8 +237,7 @@ namespace spot
protected:
typedef label label_t;
- typedef std::unordered_map ns_map;
+ typedef std::unordered_map