15 Mar
2002
15 Mar
'02
5:32 a.m.
At 3:01 AM +0000 3/15/02, rodrigo_braz wrote:
#include <map> #include <ostream>
#include <iostream>
#include "boost/iterator_adaptors.hpp" #include <algorithm>
using namespace std; using namespace boost;
struct pair_is_active { bool operator()(const pair
& p) { return 0 < p.second; } }; ostream& operator<<(ostream& o, pair
p) { return o << "(" << p.first << ", " << p.second << ")"; } int main() { map
m; m[0] = 10; m[1] = 15; m[2] = 0; m[3] = 13; copy(boost::make_filter_iterator
(m.begin, m.end()),
copy(boost::make_filter_iterator
boost::make_filter_iterator
(m.end(), m.end()), ostream_iterator >(cout,",")); return 0; }
-- Jon Kalb Kalb@LibertySoft.com