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.