williamr@2: /* williamr@2: * Copyright (c) 1999 williamr@2: * Silicon Graphics Computer Systems, Inc. williamr@2: * williamr@2: * Permission to use, copy, modify, distribute and sell this software williamr@2: * and its documentation for any purpose is hereby granted without fee, williamr@2: * provided that the above copyright notice appear in all copies and williamr@2: * that both that copyright notice and this permission notice appear williamr@2: * in supporting documentation. Silicon Graphics makes no williamr@2: * representations about the suitability of this software for any williamr@2: * purpose. It is provided "as is" without express or implied warranty. williamr@4: */ williamr@2: williamr@2: // WARNING: This is an internal header file, included by other C++ williamr@2: // standard library headers. You should not attempt to use this header williamr@2: // file directly. williamr@2: williamr@2: #ifndef _STLP_INTERNAL_CTRAITS_FUNCTIONS_H williamr@2: #define _STLP_INTERNAL_CTRAITS_FUNCTIONS_H williamr@2: williamr@4: #ifndef _STLP_INTERNAL_FUNCTION_BASE_H williamr@2: # include williamr@4: #endif williamr@2: williamr@2: // This file contains a few small adapters that allow a character williamr@2: // traits class to be used as a function object. williamr@2: williamr@2: _STLP_BEGIN_NAMESPACE williamr@2: williamr@4: _STLP_MOVE_TO_PRIV_NAMESPACE williamr@4: williamr@2: template williamr@2: struct _Eq_traits williamr@2: : public binary_function { williamr@2: bool operator()(const typename _Traits::char_type& __x, williamr@2: const typename _Traits::char_type& __y) const williamr@4: { return _Traits::eq(__x, __y); } williamr@2: }; williamr@2: williamr@2: template williamr@2: struct _Eq_char_bound williamr@4: : public unary_function { williamr@2: typename _Traits::char_type __val; williamr@2: _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {} williamr@2: bool operator()(const typename _Traits::char_type& __x) const williamr@4: { return _Traits::eq(__x, __val); } williamr@2: }; williamr@2: williamr@2: template williamr@2: struct _Neq_char_bound williamr@2: : public unary_function williamr@2: { williamr@2: typename _Traits::char_type __val; williamr@2: _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {} williamr@2: bool operator()(const typename _Traits::char_type& __x) const williamr@4: { return !_Traits::eq(__x, __val); } williamr@2: }; williamr@2: williamr@2: template williamr@2: struct _Eq_int_bound williamr@4: : public unary_function { williamr@2: typename _Traits::int_type __val; williamr@2: williamr@2: _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {} williamr@2: bool operator()(const typename _Traits::char_type& __x) const williamr@4: { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); } williamr@2: }; williamr@2: williamr@4: #if 0 williamr@2: template williamr@2: struct _Lt_traits williamr@2: : public binary_function { williamr@2: bool operator()(const typename _Traits::char_type& __x, williamr@2: const typename _Traits::char_type& __y) const williamr@4: { return _Traits::lt(__x, __y); } williamr@2: }; williamr@4: #endif williamr@4: williamr@4: _STLP_MOVE_TO_STD_NAMESPACE williamr@2: williamr@2: _STLP_END_NAMESPACE williamr@2: williamr@2: #endif /* _STLP_INTERNAL_CTRAITS_FUNCTIONS_H */ williamr@2: williamr@2: // Local Variables: williamr@2: // mode:C++ williamr@2: // End: