[ANN] Oven 1.0, range-based STL algorithm library

S

shunsuke

Hi, all.

After combating for a few years,
Oven 1.0, which is a range-based STL algorithm library, has been
released.

Document:
http://p-stade.sourceforge.net/oven/index.html

Download:
http://tinyurl.com/2eooc9
http://sourceforge.net/project/showfiles.php?group_id=141222&package_id=173059
(Oven is a part of pstade package, which is a header-only library
so that you don't need to build it.)

Oven depends on the Boost.Range concepts:
http://www.boost.org/libs/range/doc/range.html

See also "Range Library Proposal":
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1871.html

Put simply, the Range concept is a pair of "begin" and "end" STL
Iterator.
(std::pair<int*, int*> is actually a conforming Range.)
Once "begin" and "end" Iterators are packed into a Range,
it can compete with list functions which functional languages offer.
You can make an infinite, lazy, filtered, zipped, tokenized, jointed,
concatenated, cycled, reversed, memoized, and even recursive range.
(In fact, Oven aims to port Haskell list functions into C++.)

An example "Infinite sequence of factorials":

namespace lambda = boost::lambda;
using namespace pstade::eek:ven;

void test()
{
BOOST_AUTO(factorials,
expression(counting(1, max_count)|scanned(1,
regular(lambda::_1 * lambda::_2))) );

int const answer[] = { 1,1,2,6,24,120,720,5040,40320,362880 };
BOOST_CHECK( equals(factorials|taken(10), answer) );
}

Note that this (nearly)infinite sequence is in essence based only on
Iterator concepts, with which we are familiar for years.

Enjoy Range programming!



Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top