epoc32/include/stdapis/stlportv5/stl/_ctraits_fns.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_ctraits_fns.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,95 @@
     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_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 +template <class _Traits>
    1.34 +struct _Eq_traits
    1.35 +  : public binary_function<typename _Traits::char_type,
    1.36 +                           typename _Traits::char_type,
    1.37 +                           bool>
    1.38 +{
    1.39 +  bool operator()(const typename _Traits::char_type& __x,
    1.40 +                  const typename _Traits::char_type& __y) const
    1.41 +    { return _Traits::eq(__x, __y); }
    1.42 +};
    1.43 +
    1.44 +template <class _Traits>
    1.45 +struct _Eq_char_bound
    1.46 +  : public unary_function<typename _Traits::char_type, bool>
    1.47 +{
    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 +{
    1.68 +  typename _Traits::int_type __val;
    1.69 +
    1.70 +  _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {}
    1.71 +  bool operator()(const typename _Traits::char_type& __x) const
    1.72 +    { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); }
    1.73 +};
    1.74 +
    1.75 +# if 0
    1.76 +template <class _Traits>
    1.77 +struct _Lt_traits
    1.78 +  : public binary_function<typename _Traits::char_type,
    1.79 +                           typename _Traits::char_type,
    1.80 +                           bool>
    1.81 +{
    1.82 +  bool operator()(const typename _Traits::char_type& __x,
    1.83 +                  const typename _Traits::char_type& __y) const
    1.84 +    { return _Traits::lt(__x, __y); }
    1.85 +};
    1.86 +# endif
    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:
    1.95 +
    1.96 +
    1.97 +
    1.98 +