]> Dogcows Code - chaz/yoink/blob - src/moof/cml/vector/vector_print.h
the massive refactoring effort
[chaz/yoink] / src / moof / cml / vector / vector_print.h
1 /* -*- C++ -*- ------------------------------------------------------------
2
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
4
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
7
8 *-----------------------------------------------------------------------*/
9 /** @file
10 * @brief
11 */
12
13 #ifndef vector_print_h
14 #define vector_print_h
15
16 #include <iostream>
17
18 namespace cml {
19
20 /** Output a vector to a std::ostream. */
21 template<typename E, class AT > inline std::ostream&
22 operator<<(std::ostream& os, const vector<E,AT>& v)
23 {
24 for (size_t i = 0; i < v.size(); ++i) {
25 os << " " << v[i];
26 }
27 return os;
28 }
29
30 /** Output a vector expression to a std::ostream. */
31 template< class XprT > inline std::ostream&
32 operator<<(std::ostream& os, const et::VectorXpr<XprT>& v)
33 {
34 for (size_t i = 0; i < v.size(); ++i) {
35 os << " " << v[i];
36 }
37 return os;
38 }
39
40 } // namespace cml
41
42 #endif
43
44 // -------------------------------------------------------------------------
45 // vim:ft=cpp
This page took 0.034114 seconds and 4 git commands to generate.