util - return cerr; } template <typename item_t>...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <sstream> using namespace std; #include "util.h" } const string octal (int decimal) { ostringstream ostring; ostring.setf (ios::oct); ostring << decimal; return ostring.str (); } int sys_info::exit_status = EXIT_SUCCESS; string sys_info::execname; // Must be initialized from main(). execname = argv0; cout << boolalpha; cerr << boolalpha; TRACE ('Y', "execname = " << execname); } sys_info::set_status (EXIT_FAILURE); cerr << sys_info::get_execname () << ": ";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return cerr; } template <typename item_t> ostream &operator<< (ostream &out, const vector<item_t> &vec) { typename vector<item_t>::const_iterator itor = vec.begin(); typename vector<item_t>::const_iterator end = vec.end(); // If the vector is empty, do nothing. if (itor != end) { // Print out the first element without a space. out << *itor++; // Print out the rest of the elements each preceded by a space. while (itor != end) out << " " << *itor++; } return out; } RCSC(__util_cc__, "$Id: util.cc,v 1.2 2010-01-21 18:22:36-08 - - $")...
View Full Document

This note was uploaded on 01/26/2010 for the course CMPS 109 taught by Professor Bailey,d during the Spring '08 term at University of California, Santa Cruz.

Ask a homework question - tutors are online