Files Classes Functions Hierarchy
#include <print.h>
Public Member Functions | |
| printcontainer (Iter ibeg_, Iter iend_, stringc &space_=" ") | |
| Pass in the container with its iterators. | |
| ostream & | print (ostream &os) const |
| The vector prints each sequential element and a space. | |
Public Attributes | |
| Iter | ibeg |
| The start iterator. | |
| Iter | iend |
| The end iterator. | |
| string | space |
| The client can configure the space between elements. | |
Global functions forward the printing to this class as they are the interface and this is the back end.
#include <print.h> ... vector<double> v; ... cout << print(v,"\n") << endl;
#include <print.h>
...
double a1[] = { 2.0, 4.0, 6.0, 8.0, 10.0 };
cout << print(a1,a1+5) << endl;
Definition at line 33 of file print.h.
| printcontainer< Iter >::printcontainer | ( | Iter | ibeg_, | |
| Iter | iend_, | |||
| stringc & | space_ = " " | |||
| ) | [inline] |
| ostream & printcontainer< Iter >::print | ( | ostream & | os | ) | const [inline] |
The vector prints each sequential element and a space.
Definition at line 92 of file print.h.
References printcontainer< Iter >::iend, and printcontainer< Iter >::space.
00093 { 00094 Iter i=ibeg; 00095 if (i!=iend) 00096 os << *i++; 00097 for ( ; i!=iend; ) 00098 os << space << *i++; 00099 00100 return os; 00101 }
| Iter printcontainer< Iter >::ibeg |
| Iter printcontainer< Iter >::iend |
The end iterator.
Definition at line 40 of file print.h.
Referenced by printcontainer< Iter >::print().
| string printcontainer< Iter >::space |
The client can configure the space between elements.
Definition at line 43 of file print.h.
Referenced by printcontainer< Iter >::print().
1.5.8