// istring.cpp: The template basic_string applied to 
//              integers.
// Copied from:
//    Ammeraal, L. (2000) C++ for Programmers, 3rd Ed., Chichester: Wiley,
//    p. 242.
// This program does not compile with gcc (see version below).
#include <string>
#include <iostream>
using namespace std;

typedef basic_string<int> istring; // int instead of char!

int main()
{  istring s;
   s += 123;
   s += 98;
   s += 45;
   for (int i=0; i<s.length(); ++i)
      cout << s[i] << endl;
   return 0;
}

