Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
symbol.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <boost/flyweight.hpp>
4 #include <boost/flyweight/no_tracking.hpp>
5 
6 namespace std
7 {
8  template <typename T>
9  struct hash<boost::flyweight<T, boost::flyweights::no_tracking>>
10  {
11  using value_type = boost::flyweight<T, boost::flyweights::no_tracking>;
12  size_t operator()(const value_type& ss) const
13  {
14  // http://lists.boost.org/boost-users/2013/03/78007.php
15  hash<const void*> hasher;
16  return hasher(&ss.get());
17  }
18  };
19 }
20 
21 namespace vcsn
22 {
24  using symbol = boost::flyweight<std::string, boost::flyweights::no_tracking>;
25 }
boost::flyweight< T, boost::flyweights::no_tracking > value_type
Definition: symbol.hh:11
boost::flyweight< std::string, boost::flyweights::no_tracking > symbol
An internalized string.
Definition: symbol.hh:24