Boost logo

Boost :

From: Robert Jones (robertgbjones_at_[hidden])
Date: 2008-07-11 08:54:31


Is it possible to invoke user defined streaming operators within boost
lambda
functions? In this style

#include <iostream>
#include <map>
#include "boost/lambda/lambda.hpp"

using namespace std;

ostream & operator << ( ostream & ostrm, pair<string, string> const & input
);

ostream & operator << ( ostream & ostrm, map<string, string> & inputs )
{
  using namespace boost :: lambda;

  for_each ( inputs.begin( ), inputs.end( ), ostrm << _1 << '\n' );
  return ostrm;
}

Is this basically undoable, or am I doing it wrong? Also, does the
online Comeau compiler understand the boost include directives?

Thanks, Rob.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk