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