There are two key reasons and one minor reason why FC++ is better than using function pointers for implementing higher-order functions in C++. First, function pointers are monomorphic--you cannot create a pointer to a polymorphic (template) function. (You can create a pointer to one of its monomorphic instances, but you lose the polymorphic power in doing so.) FC++ can pass polymorphic functions as parameters. Second, function pointers can only point to functions that explicitly appear in the code. For instance, one cannot create a function pointer to a function created by specializing another function. Finally, function pointers add a layer of run-time indirection that can slow down your program by hindering optimizations like inlining. FC++ uses member function templates so even higher-order instantiations can be inlined.
"Functoids" in FC++ are similar to "Adaptable N-ary Functions" in the STL, in that they use nested typedefs to encode argument and result types to enable composition of higher-order functions. The key difference is that the STL's "Adaptables" are all monomorphic. For instance, you can pass plus<int>() as an argument to many STL functions, but you must fix the argument type (int in this example). With FC++, you can just pass Plus() to a polymorphic higher-order function, and have the argument types be deduced later/elsewhere.
Any conformant C++ compiler should work; see the compiler page for details.
Probably not. In principle, if you need to use a functional idiom in your program, FC++ is one of the most efficient ways to do it. Sections 4 and 5 of the paper Functional Programming with the FC++ Library contain an analysis of the run-time performance of the library.
A lot of programming patterns could be written more concisely with FC++. An example would be lazy data structures (where the members of the structure are not evaluated until needed). Another example would be type-safe callbacks: the Observer design pattern essentially implements callbacks in an object-oriented way, but with functional idioms the same can be done more cleanly. Finally, function specialization is very straightforward so new functions can be created from fixing some arguments of old ones. The paper FC++: Functional Tools for OO Tasks describes how FC++ can be used in the implementation of design patterns.
The functions named above are all part of Haskell's standard library (called the Standard Prelude). Haskell is a modern pure functional programming language, and much of the functionality of FC++ mimics Haskell exactly. This is meant to make FC++ more accessible to the "functional programming crowd" who may be less familiar with C++.
In this example, enumFrom(1) creates an infinite list of integers (1, 2, 3, ...), odd is a function which returns true if its argument is odd, map works like MAPCAR in LISP by applying its argument to each element of a list, and take selects the first N elements of a list. As a result, the expression above resolves to the list (true, false, true, false, true).
For documentation of the meaning of the FC++ functoids defined in
prelude.h,
you should check out the documentation
of the corresponding Haskell functions (see section "A.1" that starts
about half way down the page).
FC++ is the first library to enable polymorphic higher-order functions
that have polymorphic arguments. In the past, if one wanted to express
polymorphic functions in C++, these couldn't be used as arguments to other
functions. This may seem like a detail, but it is particularly useful in
C++ because of the limited type inference capabilities of the language.
For instance, consider the standard FC++ example:
take(5, map(odd, enumFrom(1))) .
Without the ability to have polymorphic functions that take other polymorphic
functions as arguments, odd would have to be monomorphic (i.e.,
it would lose in generality). With FC++ we have a fully general definition
of odd, pass it to map and let map determine its required
type later. An even better example is:
compose(tail, tail).
The above composition is a polymorphic function (assuming that tail
is also polymorphic). No C++ library before FC++ supported something similar.
FC++ also offers several expressiveness and performance enhancements
over older libraries for functional programming in C++. It defines a subtyping
policy for functions (so you can substitute a more general function where
a specific one is expected), it offers efficient memory management, it
defines a wealth of operators commonly found in functional languages, it
provides automatic currying of functoids, it
provides infix function syntax, it
comes with an implementation of a lazy list data structure, and it provides
interface functions from STL function objects, C++ function pointers,
etc. to FC++ functoids.
That depends on your definition of "functional programming language". The moniker "functional programming" is a wide umbrella (it encompasses languages as different as LISP and Haskell, for example). Nevertheless, there are some features that seem common among functional programming languages. Here is one possible enumeration of features which functional languages typically support a majority of, as well as details of how well FC++ supports them:
Features: