Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_funcbase.h
Go to the documentation of this file.
1// -*- C++ -*-
2
43#ifndef _RWSTD_RW_FUNCBASE_H_INCLUDED
44#define _RWSTD_RW_FUNCBASE_H_INCLUDED
45
46#ifndef _RWSTD_RW_DEFS_H_INCLUDED
47# include <rw/_defs.h>
48#endif // _RWSTD_RW_DEFS_H_INCLUDED
49
50
52
53
54// 20.3.1 - Base
55template <class _Arg, class _Result>
56struct unary_function
57{
58 typedef _Arg argument_type;
59 typedef _Result result_type;
60};
61
62
63#define _RWSTD_UNARY_FUNCTION_TYPES(T, U) \
64 typedef typename _STD::unary_function<T, U>::argument_type argument_type; \
65 typedef typename _STD::unary_function<T, U>::result_type result_type
66
67
68template <class _Arg1, class _Arg2, class _Result>
69struct binary_function
70{
71 typedef _Arg1 first_argument_type;
72 typedef _Arg2 second_argument_type;
73 typedef _Result result_type;
74};
75
76
77#define _RWSTD_BINARY_FUNCTION_TYPES(T, U, V) \
78 typedef typename _STD::binary_function<T, U, V>::second_argument_type \
79 second_argument_type; \
80 typedef typename _STD::binary_function<T, U, V>::first_argument_type \
81 first_argument_type; \
82 typedef typename _STD::binary_function<T, U, V>::result_type \
83 result_type
84
85
86// 20.3.3, p5
87template <class _TypeT>
88struct less: binary_function<_TypeT, _TypeT, bool>
89{
90 _RWSTD_BINARY_FUNCTION_TYPES (_TypeT, _TypeT, bool);
91
92 result_type operator() (const first_argument_type &__x,
93 const second_argument_type &__y) const {
94 return __x < __y;
95 }
96};
97
98
99} // namespace std
100
101
102#endif // _RWSTD_RW_FUNCBASE_H_INCLUDED
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
#define _RWSTD_BINARY_FUNCTION_TYPES(T, U, V)
Definition json.h:5363