2003

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                           FILE: august.cpp */
/*                                                                            */
/*  This is interesting, but will probably not become popular                 */
/*  =========================================================                 */
/*                                                                            */
/*  Compiled and tested with Visual C++ 6.0                                   */
/*                                                                            */
/*  V1.00   31-AUG-2003   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>
#include <string>

using namespace std ;

template< typename T >
ostream &operator<<( ostream &os, const basic_string<T> &str )
{
   for( basic_string<T>::const_iterator it = str.begin(); it != str.end(); ++it )
      cout << (char) *it ;

   return os ;
}

int main()
{
  double values[] = { 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', ' ', '!' } ; 

  basic_string<double> dblstring( values, values + 13 ) ;

  cout << dblstring << endl ;

  return 0 ;
}