/home/ntakagi/work/STLport-5.1.5/stlport/stl/_ctraits_fns.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999
00003  * Silicon Graphics Computer Systems, Inc.
00004  *
00005  * Permission to use, copy, modify, distribute and sell this software
00006  * and its documentation for any purpose is hereby granted without fee,
00007  * provided that the above copyright notice appear in all copies and
00008  * that both that copyright notice and this permission notice appear
00009  * in supporting documentation.  Silicon Graphics makes no
00010  * representations about the suitability of this software for any
00011  * purpose.  It is provided "as is" without express or implied warranty.
00012  */
00013 
00014 // WARNING: This is an internal header file, included by other C++
00015 // standard library headers.  You should not attempt to use this header
00016 // file directly.
00017 
00018 #ifndef _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
00019 #define _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
00020 
00021 #ifndef _STLP_INTERNAL_FUNCTION_BASE_H
00022 #  include <stl/_function_base.h>
00023 #endif
00024 
00025 // This file contains a few small adapters that allow a character
00026 // traits class to be used as a function object.
00027 
00028 _STLP_BEGIN_NAMESPACE
00029 
00030 _STLP_MOVE_TO_PRIV_NAMESPACE
00031 
00032 template <class _Traits>
00033 struct _Eq_traits
00034   : public binary_function<typename _Traits::char_type,
00035                            typename _Traits::char_type,
00036                            bool> {
00037   bool operator()(const typename _Traits::char_type& __x,
00038                   const typename _Traits::char_type& __y) const
00039   { return _Traits::eq(__x, __y); }
00040 };
00041 
00042 template <class _Traits>
00043 struct _Eq_char_bound
00044   : public unary_function<typename _Traits::char_type, bool> {
00045   typename _Traits::char_type __val;
00046   _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
00047   bool operator()(const typename _Traits::char_type& __x) const
00048   { return _Traits::eq(__x, __val); }
00049 };
00050 
00051 template <class _Traits>
00052 struct _Neq_char_bound
00053   : public unary_function<typename _Traits::char_type, bool>
00054 {
00055   typename _Traits::char_type __val;
00056   _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
00057   bool operator()(const typename _Traits::char_type& __x) const
00058   { return !_Traits::eq(__x, __val); }
00059 };
00060 
00061 template <class _Traits>
00062 struct _Eq_int_bound
00063   : public unary_function<typename _Traits::char_type, bool> {
00064   typename _Traits::int_type __val;
00065 
00066   _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {}
00067   bool operator()(const typename _Traits::char_type& __x) const
00068   { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); }
00069 };
00070 
00071 #if 0
00072 template <class _Traits>
00073 struct _Lt_traits
00074   : public binary_function<typename _Traits::char_type,
00075                            typename _Traits::char_type,
00076                            bool> {
00077   bool operator()(const typename _Traits::char_type& __x,
00078                   const typename _Traits::char_type& __y) const
00079   { return _Traits::lt(__x, __y); }
00080 };
00081 #endif
00082 
00083 _STLP_MOVE_TO_STD_NAMESPACE
00084 
00085 _STLP_END_NAMESPACE
00086 
00087 #endif /* _STLP_INTERNAL_CTRAITS_FUNCTIONS_H */
00088 
00089 // Local Variables:
00090 // mode:C++
00091 // End:



Generated on Mon Mar 10 15:32:20 2008 by  doxygen 1.5.1