00001 /* 00002 * Copyright (C) 2009 Cyril Soldani 00003 * 00004 * This file is part of QuickCheck++. 00005 * 00006 * QuickCheck++ is free software: you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the Free 00008 * Software Foundation, either version 3 of the License, or (at your option) 00009 * any later version. 00010 * 00011 * QuickCheck++ is distributed in the hope that it will be useful, but WITHOUT 00012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00014 * more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along with 00017 * QuickCheck++. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00032 #ifndef QUICKCHECK_OSTREAM_H 00033 #define QUICKCHECK_OSTREAM_H 00034 00035 #include <iostream> 00036 #include <vector> 00037 00038 namespace quickcheck { 00039 00048 template<class A> 00049 std::ostream& operator<<(std::ostream& out, const std::vector<A>& xs) 00050 { 00051 out << "["; 00052 for (size_t i = 0; i < xs.size(); ++i) 00053 if (i == xs.size() - 1) 00054 out << xs[i]; 00055 else 00056 out << xs[i] << ", "; 00057 return out << "]"; 00058 } 00059 00060 } 00061 00062 #endif // !QUICKCHECK_OSTREAM_H
1.5.6