/* supplementing compose function objects * Son Dez 26 22:11:12 MET 1999 */
#ifndef BOOST_COMPOSE_HPP
#define BOOST_COMPOSE_HPP
#include <functional>
namespace boost {
/********************************************************** * type nullary_function * - as supplement to unary_function and binary_function **********************************************************/
template <class Result>
struct nullary_function {
typedef Result result_type;
};
/********************************************************** * ptr_fun for functions with no argument **********************************************************/
template <class Result>
class pointer_to_nullary_function : public nullary_function<Result>
{
protected:
Result (*ptr)();
public:
pointer_to_nullary_function() {
}
explicit pointer_to_nullary_function(Result (*x)()) : ptr(x) {
}
Result operator()() const {
return ptr();
}
};
/* convenience functions for the compose_f_g adapter */
template <class OP1, class OP2>
inline compose_f_g_t<OP1,OP2>
compose_f_g (const OP1& o1, const OP2& o2) {
return compose_f_g_t<OP1,OP2>(o1,o2);
}
} /* namespace boost */
#endif /*BOOST_COMPOSE_HPP*/
/* supplementing compose function objects * Son Dez 26 22:14:55 MET 1999 */
#ifndef BOOST_COMPOSE_HPP
#define BOOST_COMPOSE_HPP
#include <functional>
namespace boost {
/********************************************************** * type nullary_function * - as supplement to unary_function and binary_function **********************************************************/
template <class Result>
struct nullary_function {
typedef Result result_type;
};
/********************************************************** * ptr_fun for functions with no argument **********************************************************/
template <class Result>
class pointer_to_nullary_function : public nullary_function<Result>
{
protected:
Result (*ptr)();
public:
pointer_to_nullary_function() {
}
explicit pointer_to_nullary_function(Result (*x)()) : ptr(x) {
}
Result operator()() const {
return ptr();
}
};