epoc32/include/tools/stlport/stl/_ctraits_fns.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
 * Copyright (c) 1999
williamr@4
     3
 * Silicon Graphics Computer Systems, Inc.
williamr@4
     4
 *
williamr@4
     5
 * Permission to use, copy, modify, distribute and sell this software
williamr@4
     6
 * and its documentation for any purpose is hereby granted without fee,
williamr@4
     7
 * provided that the above copyright notice appear in all copies and
williamr@4
     8
 * that both that copyright notice and this permission notice appear
williamr@4
     9
 * in supporting documentation.  Silicon Graphics makes no
williamr@4
    10
 * representations about the suitability of this software for any
williamr@4
    11
 * purpose.  It is provided "as is" without express or implied warranty.
williamr@4
    12
 */
williamr@4
    13
williamr@4
    14
// WARNING: This is an internal header file, included by other C++
williamr@4
    15
// standard library headers.  You should not attempt to use this header
williamr@4
    16
// file directly.
williamr@4
    17
williamr@4
    18
#ifndef _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
williamr@4
    19
#define _STLP_INTERNAL_CTRAITS_FUNCTIONS_H
williamr@4
    20
williamr@4
    21
#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
williamr@4
    22
#  include <stl/_function_base.h>
williamr@4
    23
#endif
williamr@4
    24
williamr@4
    25
// This file contains a few small adapters that allow a character
williamr@4
    26
// traits class to be used as a function object.
williamr@4
    27
williamr@4
    28
_STLP_BEGIN_NAMESPACE
williamr@4
    29
williamr@4
    30
_STLP_MOVE_TO_PRIV_NAMESPACE
williamr@4
    31
williamr@4
    32
template <class _Traits>
williamr@4
    33
struct _Eq_traits
williamr@4
    34
  : public binary_function<typename _Traits::char_type,
williamr@4
    35
                           typename _Traits::char_type,
williamr@4
    36
                           bool> {
williamr@4
    37
  bool operator()(const typename _Traits::char_type& __x,
williamr@4
    38
                  const typename _Traits::char_type& __y) const
williamr@4
    39
  { return _Traits::eq(__x, __y); }
williamr@4
    40
};
williamr@4
    41
williamr@4
    42
template <class _Traits>
williamr@4
    43
struct _Eq_char_bound
williamr@4
    44
  : public unary_function<typename _Traits::char_type, bool> {
williamr@4
    45
  typename _Traits::char_type __val;
williamr@4
    46
  _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
williamr@4
    47
  bool operator()(const typename _Traits::char_type& __x) const
williamr@4
    48
  { return _Traits::eq(__x, __val); }
williamr@4
    49
};
williamr@4
    50
williamr@4
    51
template <class _Traits>
williamr@4
    52
struct _Neq_char_bound
williamr@4
    53
  : public unary_function<typename _Traits::char_type, bool>
williamr@4
    54
{
williamr@4
    55
  typename _Traits::char_type __val;
williamr@4
    56
  _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {}
williamr@4
    57
  bool operator()(const typename _Traits::char_type& __x) const
williamr@4
    58
  { return !_Traits::eq(__x, __val); }
williamr@4
    59
};
williamr@4
    60
williamr@4
    61
template <class _Traits>
williamr@4
    62
struct _Eq_int_bound
williamr@4
    63
  : public unary_function<typename _Traits::char_type, bool> {
williamr@4
    64
  typename _Traits::int_type __val;
williamr@4
    65
williamr@4
    66
  _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {}
williamr@4
    67
  bool operator()(const typename _Traits::char_type& __x) const
williamr@4
    68
  { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); }
williamr@4
    69
};
williamr@4
    70
williamr@4
    71
#if 0
williamr@4
    72
template <class _Traits>
williamr@4
    73
struct _Lt_traits
williamr@4
    74
  : public binary_function<typename _Traits::char_type,
williamr@4
    75
                           typename _Traits::char_type,
williamr@4
    76
                           bool> {
williamr@4
    77
  bool operator()(const typename _Traits::char_type& __x,
williamr@4
    78
                  const typename _Traits::char_type& __y) const
williamr@4
    79
  { return _Traits::lt(__x, __y); }
williamr@4
    80
};
williamr@4
    81
#endif
williamr@4
    82
williamr@4
    83
_STLP_MOVE_TO_STD_NAMESPACE
williamr@4
    84
williamr@4
    85
_STLP_END_NAMESPACE
williamr@4
    86
williamr@4
    87
#endif /* _STLP_INTERNAL_CTRAITS_FUNCTIONS_H */
williamr@4
    88
williamr@4
    89
// Local Variables:
williamr@4
    90
// mode:C++
williamr@4
    91
// End: