Home | Libraries | People | FAQ | More |
FC++ has a number of application areas, which we describe here briefly.
FC++ STL/boost::bind ==== =============== fcpp::plus std::plus<int>() minus(_,3) std::bind2nd( std::plus<int>(), 3 ) minus(_,3) boost::bind( std::plus<int>(), _1, 3 )though for a number of small cases, boost::lambda provides the tiniest code:
FC++ boost::lambda ==== ============= minus(_,3) _1 - 3FC++'s lambda syntax is explicit, which sometimes makes it easier to create complicated functions on the fly. Here is a somewhat contrived example (loosely based on a thread on the Boost mailing list):
void g( std::string s, int x ); void h( fcpp::fun0<void> f ); ... fcpp::fun1<int,void> f = lambda(X)[ ptr_to_fun(h)[ lambda()[ ptr_to_fun(g)[ std::string("hi"), X ] ] ] ];which is relatively straightforward to express using FC++, but difficult to express using boost::{lambda,function,bind}.
Prior to "Boost FC++", the main "audience" for FC++ was the functional programming research community. We hope that inclusion in Boost will help find more matches between the general C++ community's needs and the features provided by FC++.
Last revised: October 03, 2003 at 23:27:22 GMT | Copyright © 2000-2003 Brian McNamara and Yannis Smaragdakis |