30 #ifndef __CLAW_FUNCTIONAL_HPP__
31 #define __CLAW_FUNCTIONAL_HPP__
43 template <
class T1,
class T2>
44 class first:
public std::unary_function< std::pair<T1, T2>, T1& >
47 T1& operator()( std::pair<T1, T2>& p )
const
58 template <
class T1,
class T2>
60 public std::unary_function<const std::pair<T1, T2>, const T1&>
63 const T1& operator()(
const std::pair<T1, T2>& p )
const
79 public first<typename Pair::first_type, typename Pair::second_type>
93 public const_first<typename Pair::first_type, typename Pair::second_type>
103 template <
class T1,
class T2>
104 class second:
public std::unary_function< std::pair<T1, T2>, T2& >
107 T2& operator()( std::pair<T1, T2>& p )
const
118 template <
class T1,
class T2>
120 public std::unary_function< const std::pair<T1, T2>, const T2& >
123 const T2& operator()(
const std::pair<T1, T2>& p )
const
137 template<
class Pair >
139 typename Pair::second_type >
153 public const_second<typename Pair::first_type, typename Pair::second_type>
158 template<
typename F,
typename S>
179 bool operator()(
const T& t )
const {
return true; }
194 template<
class T,
class U>
198 bool operator()(
const T& t,
const U& u )
const
216 template<
typename F1,
typename F2>
218 :
public std::unary_function< typename F2::argument_type,
219 typename F1::result_type >
231 template<
typename G1,
typename G2>
237 typename F1::result_type
240 return F1()( F2()(a) );
258 void operator()(
const T& a )
const
275 class clone:
public std::unary_function<T*, T*>
278 T* operator()(
const T* a )
const
295 public std::unary_function<T*, T&>
298 T& operator()( T* a )
const
316 public std::unary_function<const T*, const T&>
323 const T& operator()(
const T* a )
const
331 #endif // __CLAW_FUNCTIONAL_HPP__