
Dear boosters, I have updated the Iterable Range Library (formely known as Range Templates Library). It makes dealing with containers/STL algorithms simpler by using ranges (as opposed to iterators). Simply put, a range is a smarter std::pair<iterator,iterator>. Here's a taste: for ( crange<some_array_type> r(some_array); r; ++r) do_something( *r, some_data); Also, the library provides wrappers for all STL algorithms (for the purpose of STL algorithms, all containers are ranges as well): typedef std::vector<std::string> word_array; word_array v; // STL version std::copy( v.begin(), v.end(), print); // rng:: version rng::copy( v, print); Also, the counterparts for STL algorithms that return an iterator will return a range, allowing for: // fill a vector with all the indexes at which a certain string is found std::string str = "I'm a cool programmer, really cool that is", find = "cool"; std::vector<int> result; crange<std::string> r(str); while ( r = rng::search(r, find)) result.push_back ( r.begin() - str.begin() ); And it provides for range adaptors, allowing for composition. bool from_ro(const employee & e) { return e.country == "Romania"; } std::string get_empl_name(const employee &e) { return e.name; } typedef std::vector<employee> array; array empls; // take all employees from Romania, and print their names rng::copy( transformed( filtered(empls,from_ro), get_empl_name), std::ostream_iterator<std::string>(std::cout," ")); Changes in this version: - improved algorithms.hpp (no more use of macros) - solved small bugs - added documentation Download it from here: http://www.torjo.com/rangelib/ Feedback is welcome. Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.5 - tooltips at your fingertips (work for menus too!) + bitmap buttons (work for MessageBox too!) + tab dialogs, hyper links, lite html