CMS 3D CMS Logo

triton_utils.cc
Go to the documentation of this file.
2 
3 #include <sstream>
4 #include <experimental/iterator>
5 
6 namespace triton_utils {
7 
8  template <typename C>
9  std::string printColl(const C& coll, const std::string& delim) {
10  if (coll.empty())
11  return "";
12  std::stringstream msg;
13  //avoid trailing delim
14  std::copy(std::begin(coll), std::end(coll), std::experimental::make_ostream_joiner(msg, delim));
15  return msg.str();
16  }
17 
18 } // namespace triton_utils
19 
20 template std::string triton_utils::printColl(const edm::Span<std::vector<int64_t>::const_iterator>& coll,
21  const std::string& delim);
22 template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim);
23 template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim);
24 template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, const std::string& delim);
tuple msg
Definition: mps_check.py:286
Definition: Span.h:16
std::string printColl(const C &coll, const std::string &delim=", ")
Definition: triton_utils.cc:9