]> Dogcows Code - chaz/yoink/blob - src/Moof/cml/vector/vector_print.h
beginnings of scene rendering
[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 os << "[";
25 for (size_t i = 0; i < v.size(); ++i) {
26 os << " " << v[i];
27 }
28 os << " ]";
29 return os;
30 }
31
32 /** Output a vector expression to a std::ostream. */
33 template< class XprT > inline std::ostream&
34 operator<<(std::ostream& os, const et::VectorXpr<XprT>& v)
35 {
36 os << "[";
37 for (size_t i = 0; i < v.size(); ++i) {
38 os << " " << v[i];
39 }
40 os << " ]";
41 return os;
42 }
43
44 } // namespace cml
45
46 #endif
47
48 // -------------------------------------------------------------------------
49 // vim:ft=cpp
This page took 0.031215 seconds and 4 git commands to generate.