Boost logo

Boost Users :

From: Ioffe, Robert (robert.ioffe_at_[hidden])
Date: 2003-08-15 14:23:52

The following code would not compile, since it complains about trying to
copy cout. Any comments?




#include <string>

#include <map>

#include <vector>

#include <iterator>

#include "boost/lambda/lambda.hpp"

#include "boost/lambda/bind.hpp"

#include "boost/lambda/algorithm.hpp"


using namespace boost::lambda;

using namespace std;


int main() {

        string s;

        typedef map<string, int> counters_t;

        typedef counters_t::value_type counters_value_t;

        counters_t counters;

        typedef map<int, vector<string> > occurences_t;

        typedef occurences_t::value_type occurences_value_t;

        occurences_t number_of_occurences;


        while(cin >> s)



        for(map<string, int>::const_iterator it = counters.begin();

            it != counters.end(); ++it)




                (cout << bind(&occurences_value_t::first, _1) << ":\t",


                   bind(call_begin(), bind(&occurences_value_t::second,

                   bind(call_end(), bind(&occurences_value_t::second,

                   protect(cout << _1 << " ")),

                 cout << "\n"));


        return 0;


[Non-text portions of this message have been removed]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at