Boost logo

Boost :

Subject: [boost] [lambda] Serialising Lmanda functions
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2008-10-07 11:57:14


Is there a 'standard' solution to this problem?

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

typedef std::list<unsigned> List;
std::ostream & operator<<( std::ostream & s, const List & );

int main( )
{
  using namespace boost::lambda;
  List my_list;

  ( std::cout << _1 << "\n" )( my_list );
}

The compiler cannot find a match for operator<<() because the operator
and the type are defined in different namespaces, but it's really a
nuisance!

- Rob.


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