2001

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                            FILE: march.cpp */
/*                                                                            */
/*  In case you can't see it: I just pass cout.put to for_each ...            */
/*  ==============================================================            */
/*                                                                            */
/*  Compiled and tested with Visual C++ V6.0                                  */
/*                                                                            */
/*  V1.00   25-MAR-2001   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>
#include <algorithm>
#include <functional>

using namespace std ;

int main()
{
 string str = "Hello World !\n" ;

 for_each( str.begin(), str.end(), 
    bind1st( mem_fun1_t< basic_ostream<char>&, basic_ostream<char>, char >(cout.put), &cout )
 ) ;

 return 0 ;
}