epoc32/include/stdapis/stlport/stl/wrappers/_deque.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
/*
williamr@2
     2
 *
williamr@2
     3
 * Copyright (c) 1994
williamr@2
     4
 * Hewlett-Packard Company
williamr@2
     5
 *
williamr@2
     6
 * Copyright (c) 1996,1997
williamr@2
     7
 * Silicon Graphics Computer Systems, Inc.
williamr@2
     8
 *
williamr@2
     9
 * Copyright (c) 1997
williamr@2
    10
 * Moscow Center for SPARC Technology
williamr@2
    11
 *
williamr@2
    12
 * Copyright (c) 1999 
williamr@2
    13
 * Boris Fomitchev
williamr@2
    14
 *
williamr@2
    15
 * This material is provided "as is", with absolutely no warranty expressed
williamr@2
    16
 * or implied. Any use is at your own risk.
williamr@2
    17
 *
williamr@2
    18
 * Permission to use or copy this software for any purpose is hereby granted 
williamr@2
    19
 * without fee, provided the above notices are retained on all copies.
williamr@2
    20
 * Permission to modify the code and to distribute modified code is granted,
williamr@2
    21
 * provided the above notices are retained, and a notice that the code was
williamr@2
    22
 * modified is included with the above copyright notice.
williamr@2
    23
 *
williamr@2
    24
 */
williamr@2
    25
williamr@2
    26
#ifndef _STLP_INTERNAL_DEQUE_H
williamr@2
    27
# include <stl/_deque.h>
williamr@2
    28
#endif
williamr@2
    29
williamr@2
    30
# if defined (_STLP_DEBUG)
williamr@2
    31
#  define _DEQUE_SUPER_NAME _DBG_deque
williamr@2
    32
# else
williamr@2
    33
#  define _DEQUE_SUPER_NAME __deque__
williamr@2
    34
# endif
williamr@2
    35
williamr@2
    36
# define _DEQUE_SUPER   _DEQUE_SUPER_NAME<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
williamr@2
    37
williamr@2
    38
_STLP_BEGIN_NAMESPACE
williamr@2
    39
williamr@2
    40
// provide a "default" deque adaptor
williamr@2
    41
template <class _Tp>
williamr@2
    42
class deque : public _DEQUE_SUPER {
williamr@2
    43
public:
williamr@2
    44
  typedef deque<_Tp> _Self;
williamr@2
    45
  typedef _DEQUE_SUPER _Super;
williamr@2
    46
  __IMPORT_WITH_REVERSE_ITERATORS(_Super)
williamr@2
    47
    __IMPORT_SUPER_COPY_ASSIGNMENT(deque, _Self, _DEQUE_SUPER)
williamr@2
    48
    deque() : _DEQUE_SUPER() { }
williamr@2
    49
  deque(size_type __n, const _Tp& __value) : _DEQUE_SUPER(__n, __value) { }
williamr@2
    50
  explicit deque(size_type __n) : _DEQUE_SUPER(__n) { }
williamr@2
    51
  deque(const _Tp* __first, const _Tp* __last) : _DEQUE_SUPER(__first, __last) { }
williamr@2
    52
  deque(const_iterator __first, const_iterator __last) : _DEQUE_SUPER(__first, __last) { }
williamr@2
    53
  ~deque() { }
williamr@2
    54
};
williamr@2
    55
williamr@2
    56
#  if defined (_STLP_BASE_MATCH_BUG)
williamr@2
    57
template <class _Tp>
williamr@2
    58
inline bool 
williamr@2
    59
operator==(const deque<_Tp>& __x, const deque<_Tp>& __y) {
williamr@2
    60
    return __x.size() == __y.size() && equal(__x.begin(), __x.end(), __y.begin());
williamr@2
    61
}
williamr@2
    62
williamr@2
    63
template <class _Tp>
williamr@2
    64
inline bool 
williamr@2
    65
operator<(const deque<_Tp>& __x, const deque<_Tp>& __y) {
williamr@2
    66
    return lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());
williamr@2
    67
}
williamr@2
    68
#  endif /* BASE_MATCH_BUG */
williamr@2
    69
williamr@2
    70
# undef _DEQUE_SUPER
williamr@2
    71
williamr@2
    72
_STLP_END_NAMESPACE  
williamr@2
    73
williamr@2
    74
// Local Variables:
williamr@2
    75
// mode:C++
williamr@2
    76
// End: