ReactOS  0.4.14-dev-376-gaedba84
_ctraits_fns.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Permission to use, copy, modify, distribute and sell this software
6  * and its documentation for any purpose is hereby granted without fee,
7  * provided that the above copyright notice appear in all copies and
8  * that both that copyright notice and this permission notice appear
9  * in supporting documentation. Silicon Graphics makes no
10  * representations about the suitability of this software for any
11  * purpose. It is provided "as is" without express or implied warranty.
12  */
13 
14 // WARNING: This is an internal header file, included by other C++
15 // standard library headers. You should not attempt to use this header
16 // file directly.
17 
18 #ifndef _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
19 #define _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
20 
21 #ifndef _STLP_INTERNAL_FUNCTION_BASE_H
22 # include <stl/_function_base.h>
23 #endif
24 
25 // This file contains a few small adapters that allow a character
26 // traits class to be used as a function object.
27 
29 
31 
32 template <class _Traits>
33 struct _Eq_traits
34  : public binary_function<typename _Traits::char_type,
35  typename _Traits::char_type,
36  bool> {
37  bool operator()(const typename _Traits::char_type& __x,
38  const typename _Traits::char_type& __y) const
39  { return _Traits::eq(__x, __y); }
40 };
41 
42 template <class _Traits>
44  : public unary_function<typename _Traits::char_type, bool> {
45  typename _Traits::char_type __val;
46  _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
47  bool operator()(const typename _Traits::char_type& __x) const
48  { return _Traits::eq(__x, __val); }
49 };
50 
51 template <class _Traits>
53  : public unary_function<typename _Traits::char_type, bool>
54 {
55  typename _Traits::char_type __val;
56  _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
57  bool operator()(const typename _Traits::char_type& __x) const
58  { return !_Traits::eq(__x, __val); }
59 };
60 
61 template <class _Traits>
63  : public unary_function<typename _Traits::char_type, bool> {
64  typename _Traits::int_type __val;
65 
66  _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {}
67  bool operator()(const typename _Traits::char_type& __x) const
68  { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); }
69 };
70 
71 #if 0
72 template <class _Traits>
73 struct _Lt_traits
74  : public binary_function<typename _Traits::char_type,
75  typename _Traits::char_type,
76  bool> {
77  bool operator()(const typename _Traits::char_type& __x,
78  const typename _Traits::char_type& __y) const
79  { return _Traits::lt(__x, __y); }
80 };
81 #endif
82 
84 
86 
87 #endif /* _STLP_INTERNAL_CTRAITS_FUNCTIONS_H */
88 
89 // Local Variables:
90 // mode:C++
91 // End:
bool operator()(const typename _Traits::char_type &__x) const
Definition: _ctraits_fns.h:57
_Traits::char_type __val
Definition: _ctraits_fns.h:45
bool operator()(const typename _Traits::char_type &__x) const
Definition: _ctraits_fns.h:47
bool operator()(const typename _Traits::char_type &__x, const typename _Traits::char_type &__y) const
Definition: _ctraits_fns.h:37
bool operator()(const typename _Traits::char_type &__x) const
Definition: _ctraits_fns.h:67
_Neq_char_bound(typename _Traits::char_type __c)
Definition: _ctraits_fns.h:56
#define eq(received, expected, label, type)
Definition: locale.c:144
#define __c
Definition: schilyio.h:209
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
_Eq_int_bound(typename _Traits::int_type __c)
Definition: _ctraits_fns.h:66
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
_Traits::char_type __val
Definition: _ctraits_fns.h:55
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
_Eq_char_bound(typename _Traits::char_type __c)
Definition: _ctraits_fns.h:46
_Traits::int_type __val
Definition: _ctraits_fns.h:64