epoc32/include/stdapis/stlport/stl/wrappers/_vector.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
/* NOTE: This is an internal header file, included by other STL headers.
williamr@2
    27
 *   You should not attempt to use it directly.
williamr@2
    28
 */
williamr@2
    29
williamr@2
    30
#ifndef _STLP_INTERNAL_WRAP_VECTOR_H
williamr@2
    31
#define _STLP_INTERNAL_WRAP_VECTOR_H
williamr@2
    32
williamr@2
    33
#ifndef _STLP_INTERNAL_VECTOR_H
williamr@2
    34
# include <stl/_vector.h>
williamr@2
    35
#endif
williamr@2
    36
williamr@2
    37
# if defined (_STLP_DEBUG)
williamr@2
    38
#  define _VEC_SUPER _DBG_vector<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
williamr@2
    39
# else
williamr@2
    40
#  define _VEC_SUPER __vector__<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
williamr@2
    41
# endif
williamr@2
    42
williamr@2
    43
# ifdef _STLP_USE_NAMESPACES
williamr@2
    44
namespace STLPORT { 
williamr@2
    45
# endif
williamr@2
    46
williamr@2
    47
template <class _Tp>
williamr@2
    48
class vector : public _VEC_SUPER
williamr@2
    49
{
williamr@2
    50
public:
williamr@2
    51
    typedef _VEC_SUPER  _Super;
williamr@2
    52
    __IMPORT_WITH_REVERSE_ITERATORS(_Super)
williamr@2
    53
    __IMPORT_SUPER_COPY_ASSIGNMENT(vector, vector<_Tp>, _VEC_SUPER)
williamr@2
    54
    vector() {}
williamr@2
    55
    explicit vector(size_type __n, const _Tp& __value) : _VEC_SUPER(__n, __value) { }
williamr@2
    56
    explicit vector(size_type __n) : _VEC_SUPER(__n) { }
williamr@2
    57
    vector(const_iterator __first, const_iterator __last) : _VEC_SUPER(__first,__last) { }
williamr@2
    58
# ifdef _STLP_DEBUG
williamr@2
    59
  // certainly, no member templates here !
williamr@2
    60
    vector(const _Tp* __first, const _Tp* __last) : _VEC_SUPER(__first,__last) { }    
williamr@2
    61
# endif
williamr@2
    62
    ~vector() {}
williamr@2
    63
};
williamr@2
    64
williamr@2
    65
#  if defined (_STLP_BASE_MATCH_BUG)
williamr@2
    66
template <class _Tp>
williamr@2
    67
inline bool operator==(const vector<_Tp>& __x, const vector<_Tp>& __y) {
williamr@2
    68
  return __x.size() == __y.size() &&
williamr@2
    69
    equal(__x.begin(), __x.end(), __y.begin());
williamr@2
    70
}
williamr@2
    71
williamr@2
    72
template <class _Tp>
williamr@2
    73
inline bool operator<(const vector<_Tp>& __x, const vector<_Tp>& __y) {
williamr@2
    74
  return lexicographical_compare(__x.begin(), __x.end(), 
williamr@2
    75
				 __y.begin(), __y.end());
williamr@2
    76
}
williamr@2
    77
#  endif /* _STLP_BASE_MATCH_BUG */
williamr@2
    78
#  undef _VEC_SUPER
williamr@2
    79
williamr@2
    80
// close std namespace
williamr@2
    81
# ifdef _STLP_USE_NAMESPACES
williamr@2
    82
}
williamr@2
    83
# endif
williamr@2
    84
williamr@2
    85
#endif /* _STLP_WRAP_VECTOR_H */
williamr@2
    86
williamr@2
    87
// Local Variables:
williamr@2
    88
// mode:C++
williamr@2
    89
// End: