00001
00002
00003 #ifndef TRIGBUNCHCROSSINGTOOL_SETPRINT_H
00004 #define TRIGBUNCHCROSSINGTOOL_SETPRINT_H
00005
00006
00007 #include <set>
00008 #include <iostream>
00009
00010
00011 #include "AsgTools/MsgStream.h"
00012
00014 template< typename T >
00015 std::ostream& operator<< ( std::ostream& out, const std::set< T >& var ) {
00016
00017 out << "[";
00018 typename std::set< T >::const_iterator itr = var.begin();
00019 typename std::set< T >::const_iterator end = var.end();
00020 for( ; itr != end; ++itr ) {
00021 out << *itr;
00022 if( ++itr != end ) {
00023 out << ", ";
00024 }
00025 --itr;
00026 }
00027 out << "]";
00028
00029 return out;
00030 }
00031
00033 template< typename T >
00034 MsgStream& operator<< ( MsgStream& out, const std::set< T >& var ) {
00035
00036 out << "[";
00037 typename std::set< T >::const_iterator itr = var.begin();
00038 typename std::set< T >::const_iterator end = var.end();
00039 for( ; itr != end; ++itr ) {
00040 out << *itr;
00041 if( ++itr != end ) {
00042 out << ", ";
00043 }
00044 --itr;
00045 }
00046 out << "]";
00047
00048 return out;
00049 }
00050
00051 #endif // TRIGBUNCHCROSSINGTOOL_SETPRINT_H