CVC3  2.4.1
expr_hash.h
Go to the documentation of this file.
1 /*****************************************************************************/
2 /*!
3  * \file expr_hash.h
4  * \brief Definition of the API to expression package. See class Expr for details.
5  *
6  * Author: Clark Barrett
7  *
8  * Created: Tue Nov 26 00:27:40 2002
9  *
10  * <hr>
11  *
12  * License to use, copy, modify, sell and/or distribute this software
13  * and its documentation for any purpose is hereby granted without
14  * royalty, subject to the terms and conditions defined in the \ref
15  * LICENSE file provided with this distribution.
16  *
17  * <hr>
18  *
19  * Define std::hash<Expr> and std::hash<std::string> for hash_map and
20  * hash_set over Expr class.
21  */
22 /*****************************************************************************/
23 
24 #ifndef _cvc3__expr_h_
25 #include "expr.h"
26 #endif
27 
28 #ifndef _cvc3__include__expr_hash_h_
29 #define _cvc3__include__expr_hash_h_
30 
31 #include "hash_fun.h"
32 namespace Hash
33 {
34 
35 template<> struct hash<CVC3::Expr>
36 {
37  size_t operator()(const CVC3::Expr& e) const { return e.hash(); }
38 };
39 
40 template<> class hash<std::string> {
41  private:
43  public:
44  size_t operator()(const std::string& s) const {
45  return h(s.c_str());
46  }
47 };
48 
49 }
50 
51 #endif