stl_ctraits_fns.h

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 __SGI_STL_INTERNAL_CTRAITS_FUNCTIONS_H
00019 #define __SGI_STL_INTERNAL_CTRAITS_FUNCTIONS_H
00020 
00021 // This file contains a few small adapters that allow a character
00022 // traits class to be used as a function object.
00023 
00024 __STL_BEGIN_NAMESPACE
00025 
00026 template <class _Traits>
00027 struct _Eq_traits
00028   : public binary_function<typename _Traits::char_type,
00029                            typename _Traits::char_type,
00030                            bool>
00031 {
00032   bool operator()(const typename _Traits::char_type& __x,
00033                   const typename _Traits::char_type& __y) const
00034     { return _Traits::eq(__x, __y); }
00035 };
00036 
00037 template <class _Traits>
00038 struct _Eq_int_traits
00039   : public binary_function<typename _Traits::char_type,
00040                            typename _Traits::int_type,
00041                            bool>
00042 {
00043   bool operator()(const typename _Traits::char_type& __x,
00044                   const typename _Traits::int_type& __y) const
00045     { return _Traits::eq_int_type(_Traits::to_int_type(__x), __y); }
00046 };
00047 
00048 template <class _Traits>
00049 struct _Lt_traits
00050   : public binary_function<typename _Traits::char_type,
00051                            typename _Traits::char_type,
00052                            bool>
00053 {
00054   bool operator()(const typename _Traits::char_type& __x,
00055                   const typename _Traits::char_type& __y) const
00056     { return _Traits::lt(__x, __y); }
00057 };
00058 
00059 __STL_END_NAMESPACE
00060 
00061 #endif /* __SGI_STL_INTERNAL_CTRAITS_FUNCTIONS_H */
00062 
00063 // Local Variables:
00064 // mode:C++
00065 // End:
00066 
00067 
00068 
00069 

Generated on Mon Jun 5 10:20:44 2006 for Intelligence.kdevelop by  doxygen 1.4.6