ATLAS Offline Software
Loading...
Searching...
No Matches
SetPrint.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: SetPrint.h 618129 2014-09-23 11:37:00Z krasznaa $
8#ifndef TRIGBUNCHCROSSINGTOOL_SETPRINT_H
9#define TRIGBUNCHCROSSINGTOOL_SETPRINT_H
10
11// System include(s):
12#include <set>
13#include <iostream>
14
15// Gaudi/Athena include(s):
17
19template< typename T >
20std::ostream& operator<< ( std::ostream& out, const std::set< T >& var ) {
21
22 out << "[";
23 typename std::set< T >::const_iterator itr = var.begin();
24 typename std::set< T >::const_iterator end = var.end();
25 for( ; itr != end; ++itr ) {
26 out << *itr;
27 if( ++itr != end ) {
28 out << ", ";
29 }
30 --itr;
31 }
32 out << "]";
33
34 return out;
35}
36
38template< typename T >
39MsgStream& operator<< ( MsgStream& out, const std::set< T >& var ) {
40
41 out << "[";
42 typename std::set< T >::const_iterator itr = var.begin();
43 typename std::set< T >::const_iterator end = var.end();
44 for( ; itr != end; ++itr ) {
45 out << *itr;
46 if( ++itr != end ) {
47 out << ", ";
48 }
49 --itr;
50 }
51 out << "]";
52
53 return out;
54}
55
56#endif // TRIGBUNCHCROSSINGTOOL_SETPRINT_H
std::ostream & operator<<(std::ostream &out, const std::set< T > &var)
Helper operator for printing std::set variables easily.
Definition SetPrint.h:20