void f_unordered_multiset() {
  std::unordered_multiset<int> C;
  std::unordered_multiset<int>::iterator UMSetI1 = C.begin();
  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators
  // CHECK-FIXES: auto UMSetI1 = C.begin();

  const std::unordered_multiset<int> D;
  std::unordered_multiset<int>::const_iterator UMSetI2 = D.begin();
  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when declaring iterators
  // CHECK-FIXES: auto UMSetI2 = D.begin();
}
Exemplo n.º 2
0
 void operator()(msgpack::object::with_zone& o, const std::unordered_multiset<T>& v) const {
     o.type = msgpack::type::ARRAY;
     if(v.empty()) {
         o.via.array.ptr = nullptr;
         o.via.array.size = 0;
     } else {
         uint32_t size = checked_get_container_size(v.size());
         msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size));
         msgpack::object* const pend = p + size;
         o.via.array.ptr = p;
         o.via.array.size = size;
         typename std::unordered_multiset<T>::const_iterator it(v.begin());
         do {
             *p = msgpack::object(*it, o.zone);
             ++p;
             ++it;
         } while(p < pend);
     }
 }
Exemplo n.º 3
0
 inline std::string PrettyPrint(const std::unordered_multiset<T, Hash, Predicate, Allocator>& settoprint, const bool add_delimiters=false, const std::string& separator=", ")
 {
     std::ostringstream strm;
     if (settoprint.size() > 0)
     {
         if (add_delimiters)
         {
             strm << "(";
             typename std::unordered_multiset<T, Hash, Predicate, Allocator>::const_iterator itr;
             for (itr = settoprint.begin(); itr != settoprint.end(); ++itr)
             {
                 if (itr != settoprint.begin())
                 {
                     strm << separator << PrettyPrint(*itr, add_delimiters, separator);
                 }
                 else
                 {
                     strm << PrettyPrint(*itr, add_delimiters, separator);
                 }
             }
             strm << ")";
         }
         else
         {
             typename std::unordered_multiset<T, Hash, Predicate, Allocator>::const_iterator itr;
             for (itr = settoprint.begin(); itr != settoprint.end(); ++itr)
             {
                 if (itr != settoprint.begin())
                 {
                     strm << separator << PrettyPrint(*itr, add_delimiters, separator);
                 }
                 else
                 {
                     strm << PrettyPrint(*itr, add_delimiters, separator);
                 }
             }
         }
     }
     return strm.str();
 }
Exemplo n.º 4
0
 bool operator()()
 {
     std::lock_guard<std::mutex> l(m);
     results.insert(check_id);
     return true;
 }