1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/stlport/stl/_ctraits_fns.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,91 @@
1.4 +/*
1.5 + * Copyright (c) 1999
1.6 + * Silicon Graphics Computer Systems, Inc.
1.7 + *
1.8 + * Permission to use, copy, modify, distribute and sell this software
1.9 + * and its documentation for any purpose is hereby granted without fee,
1.10 + * provided that the above copyright notice appear in all copies and
1.11 + * that both that copyright notice and this permission notice appear
1.12 + * in supporting documentation. Silicon Graphics makes no
1.13 + * representations about the suitability of this software for any
1.14 + * purpose. It is provided "as is" without express or implied warranty.
1.15 + */
1.16 +
1.17 +// WARNING: This is an internal header file, included by other C++
1.18 +// standard library headers. You should not attempt to use this header
1.19 +// file directly.
1.20 +
1.21 +#ifndef _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
1.22 +#define _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
1.23 +
1.24 +#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
1.25 +# include <stl/_function_base.h>
1.26 +#endif
1.27 +
1.28 +// This file contains a few small adapters that allow a character
1.29 +// traits class to be used as a function object.
1.30 +
1.31 +_STLP_BEGIN_NAMESPACE
1.32 +
1.33 +_STLP_MOVE_TO_PRIV_NAMESPACE
1.34 +
1.35 +template <class _Traits>
1.36 +struct _Eq_traits
1.37 + : public binary_function<typename _Traits::char_type,
1.38 + typename _Traits::char_type,
1.39 + bool> {
1.40 + bool operator()(const typename _Traits::char_type& __x,
1.41 + const typename _Traits::char_type& __y) const
1.42 + { return _Traits::eq(__x, __y); }
1.43 +};
1.44 +
1.45 +template <class _Traits>
1.46 +struct _Eq_char_bound
1.47 + : public unary_function<typename _Traits::char_type, bool> {
1.48 + typename _Traits::char_type __val;
1.49 + _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
1.50 + bool operator()(const typename _Traits::char_type& __x) const
1.51 + { return _Traits::eq(__x, __val); }
1.52 +};
1.53 +
1.54 +template <class _Traits>
1.55 +struct _Neq_char_bound
1.56 + : public unary_function<typename _Traits::char_type, bool>
1.57 +{
1.58 + typename _Traits::char_type __val;
1.59 + _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
1.60 + bool operator()(const typename _Traits::char_type& __x) const
1.61 + { return !_Traits::eq(__x, __val); }
1.62 +};
1.63 +
1.64 +template <class _Traits>
1.65 +struct _Eq_int_bound
1.66 + : public unary_function<typename _Traits::char_type, bool> {
1.67 + typename _Traits::int_type __val;
1.68 +
1.69 + _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {}
1.70 + bool operator()(const typename _Traits::char_type& __x) const
1.71 + { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); }
1.72 +};
1.73 +
1.74 +#if 0
1.75 +template <class _Traits>
1.76 +struct _Lt_traits
1.77 + : public binary_function<typename _Traits::char_type,
1.78 + typename _Traits::char_type,
1.79 + bool> {
1.80 + bool operator()(const typename _Traits::char_type& __x,
1.81 + const typename _Traits::char_type& __y) const
1.82 + { return _Traits::lt(__x, __y); }
1.83 +};
1.84 +#endif
1.85 +
1.86 +_STLP_MOVE_TO_STD_NAMESPACE
1.87 +
1.88 +_STLP_END_NAMESPACE
1.89 +
1.90 +#endif /* _STLP_INTERNAL_CTRAITS_FUNCTIONS_H */
1.91 +
1.92 +// Local Variables:
1.93 +// mode:C++
1.94 +// End: