// fo/compose21.hpp #include /* Класс композитного адаптера compose_f_gx_hx */ template class compose_f_gx_hx_t : public std::unary_function { private: OP1 op1; // Вычисление: op1(op2(x),op3(x)) OP2 op2; OP3 op3; public: // Конструктор compose_f_gx_hx_t (const OP1& o1, const OP2& o2, const OP3& o3) : op1(o1), op2(o2), op3(o3) { } // Вызов функции typename OP1::result_type operator()(const typename OP2::argument_type& x) const { return op1(op2(x),op3(x)); } }; /* Вспомогательные функции для адаптера compose_f_gx_hx */ template inline compose_f_gx_hx_t compose_f_gx_hx (const OP1& o1, const OP2& o2, const OP3& o3) { return compose_f_gx_hx_t(o1,o2,o3); }