示例#1
0
 void operator ()(Shuttler& shuttle, const char* name,
     const boost::bimap<K, V, AP1, AP2, AP3>& value) const {
   shuttle.StartSequence(name, static_cast<int>(value.size()));
   for(auto& i : value.left) {
     shuttle.Send(std::make_pair(i.first, i.second));
   }
   shuttle.EndSequence();
 }
示例#2
0
 template <typename T> static inline size_t
 insertInBimap (boost::bimap<size_t, T>& bimap, T value)
 {
     if (bimap.right.count (value) != 0)
     {
         return bimap.right.at (value);
     }
     else
     {
         size_t s = bimap.size ();
         bimap.insert (typename boost::bimap<size_t, T>::value_type (s, value));
         return s;
     }
 }