30#ifndef __CLAW_FUNCTIONAL_HPP__
31#define __CLAW_FUNCTIONAL_HPP__
42 template <
class T1,
class T2>
46 using argument_type = std::pair<T1, T2>&;
47 using result_type = T1&;
50 T1& operator()( std::pair<T1, T2>& p )
const
61 template <
class T1,
class T2>
65 using argument_type =
const std::pair<T1, T2>&;
66 using result_type =
const T1&;
69 const T1& operator()(
const std::pair<T1, T2>& p )
const
85 public first<typename Pair::first_type, typename Pair::second_type>
99 public const_first<typename Pair::first_type, typename Pair::second_type>
109 template <
class T1,
class T2>
113 using argument_type = std::pair<T1, T2>&;
114 using result_type = T2&;
117 T2& operator()( std::pair<T1, T2>& p )
const
128 template <
class T1,
class T2>
132 using argument_type =
const std::pair<T1, T2>&;
133 using result_type =
const T2&;
136 const T2& operator()(
const std::pair<T1, T2>& p )
const
150 template<
class Pair >
152 typename Pair::second_type >
165 class const_pair_second:
166 public const_second<typename Pair::first_type, typename Pair::second_type>
169 const_pair_second() {}
171 template<
typename F,
typename S>
192 using argument_type =
const T&;
193 using result_type = bool;
196 bool operator()(
const T& t )
const {
return true; }
211 template<
class T,
class U>
215 using first_argument_type =
const T&;
216 using second_argument_type =
const U&;
217 using result_type = bool;
220 bool operator()(
const T& t,
const U& u )
const
238 template<
typename F1,
typename F2>
242 using argument_type =
typename F2::argument_type;
243 using result_type =
typename F1::result_type;
255 template<
typename G1,
typename G2>
261 typename F1::result_type
264 return F1()( F2()(a) );
282 using argument_type =
const T&;
283 using result_type = void;
286 void operator()(
const T& a )
const
306 using argument_type =
const T*;
307 using result_type = T*;
310 T* operator()(
const T* a )
const
329 using argument_type = T*;
330 using result_type = T&;
333 T& operator()( T* a )
const
350 class const_dereference
353 using argument_type =
const T*;
354 using result_type =
const T&;
357 const_dereference() { }
359 const_dereference(
const const_dereference<T>& ) { }
361 const T& operator()(
const T* a )
const
Always true binary predicate.
Function object that clones a pointer.
Fuction object to get the first element of a std::pair.
Fuction object to get the first element of a std::pair.
Fuction object to get the second element of a std::pair.
Function object that deletes a pointer.
Function object that dereferences a pointer.
Fuction object to get the first element of a std::pair.
Fuction object to get the first element of a std::pair.
Fuction object to get the second element of a std::pair.
Fuction object to get the second element of a std::pair.
unary_compose(const unary_compose< G1, G2 > &that)
Copy constructor.
F1::result_type operator()(typename F2::argument_type &a) const
Return (F1 o F2)(a).
Always true unary predicate.
This is the main namespace.