Util--  1.1
unary_compose.hh
Go to the documentation of this file.
1 /* -*- C++ -*-
2  * $Id: unary_compose.hh 957 2005-03-07 16:01:20Z sjoyeux $
3  */
4 #ifndef UTILMM_FUNCTIONAL_UNARY_COMPOSE_HEADER
5 # define UTILMM_FUNCTIONAL_UNARY_COMPOSE_HEADER
6 
7 # include <functional>
8 
10 
11 namespace utilmm {
12 
30  template<class UnaryFun1, class UnaryFun2>
32  :public std::unary_function<typename UnaryFun2::argument_type,
33  typename UnaryFun1::result_type> {
34  private:
35  UnaryFun1 fun_1;
36  UnaryFun2 fun_2;
37 
38  typedef typename
40 
41  public:
55  unary_compose(UnaryFun1 const &one, UnaryFun2 const &two)
56  :fun_1(one), fun_2(two) {}
57 
66  typename UnaryFun1::result_type operator()(arg_param x)
67  const {
68  return fun_1(fun_2(x));
69  }
70 
71  }; // class utilmm::binary_compose_2<>
72 
87  template<class Fun1, class Fun2>
88  unary_compose<Fun1, Fun2> compose1(Fun1 const &f, Fun2 const &g) {
89  return unary_compose<Fun1, Fun2>(f, g);
90  }
91 
92 } // namespace utilmm
93 
94 #endif // UTILMM_FUNCTIONAL_BINARY_COMPOSE_HEADER
95 
Definition: auto_flag.hh:6
Definition of utilmm::arg_traits class.
unary_compose(UnaryFun1 const &one, UnaryFun2 const &two)
Constructor.
Definition: unary_compose.hh:55
unary_compose< Fun1, Fun2 > compose1(Fun1 const &f, Fun2 const &g)
Composition function.
Definition: unary_compose.hh:88
UnaryFun1::result_type operator()(arg_param x) const
Call operator.
Definition: unary_compose.hh:66
computed_type type
argument type
Definition: arg_traits.hh:38
Unary functors composition.
Definition: unary_compose.hh:31

Generated on Mon Sep 24 2018 17:06:40 for Util-- by doxygen 1.8.13
SourceForge.net Project Page