ATLAS Offline Software
PrintVectorHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCONFXAOD_PRINTVECTORHELPER_H
6 #define TRIGCONFXAOD_PRINTVECTORHELPER_H
7 
8 namespace {
10  template< typename T >
11  MsgStream& operator<< ( MsgStream& out,
12  const std::vector< T >& vec ) {
13 
14  // A little prefix:
15  out << "[";
16  // Print the contents:
17  for( size_t i = 0; i < vec.size(); ++i ) {
18  out << vec[ i ];
19  if( i < vec.size() - 1 ) {
20  out << ", ";
21  }
22  }
23  // A little postfix:
24  out << "]";
25  // Return the stream:
26  return out;
27  }
28 }
29 
30 #endif
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
operator<<
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
Definition: TestGaudiProperty.cxx:69