epoc32/include/stdapis/stlport/stl/wrappers/_list.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 _list.h
     1 /*
       
     2  *
       
     3  * Copyright (c) 1994
       
     4  * Hewlett-Packard Company
       
     5  *
       
     6  * Copyright (c) 1996,1997
       
     7  * Silicon Graphics Computer Systems, Inc.
       
     8  *
       
     9  * Copyright (c) 1997
       
    10  * Moscow Center for SPARC Technology
       
    11  *
       
    12  * Copyright (c) 1999 
       
    13  * Boris Fomitchev
       
    14  *
       
    15  * This material is provided "as is", with absolutely no warranty expressed
       
    16  * or implied. Any use is at your own risk.
       
    17  *
       
    18  * Permission to use or copy this software for any purpose is hereby granted 
       
    19  * without fee, provided the above notices are retained on all copies.
       
    20  * Permission to modify the code and to distribute modified code is granted,
       
    21  * provided the above notices are retained, and a notice that the code was
       
    22  * modified is included with the above copyright notice.
       
    23  *
       
    24  */
       
    25 
       
    26 /* NOTE: This is an internal header file, included by other STL headers.
       
    27  *   You should not attempt to use it directly.
       
    28  */
       
    29 
       
    30 #ifndef _STLP_INTERNAL_WRAP_LIST_H
       
    31 #define _STLP_INTERNAL_WRAP_LIST_H
       
    32 
       
    33 #ifndef _STLP_INTERNAL_LIST_H
       
    34 # include <stl/_list.h>
       
    35 #endif
       
    36 
       
    37 # ifdef _STLP_USE_NAMESPACES
       
    38 namespace STLPORT { 
       
    39 # endif
       
    40 
       
    41 # if defined (_STLP_DEBUG)
       
    42 #  define __LIST_SUPER _DBG_list<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
       
    43 # else
       
    44 #  define __LIST_SUPER __list__<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
       
    45 # endif
       
    46 
       
    47 
       
    48 // provide a "default" list adaptor
       
    49 template <class _Tp>
       
    50 class list : public __LIST_SUPER
       
    51 {
       
    52 public:
       
    53     typedef __LIST_SUPER _Super;
       
    54     __IMPORT_WITH_REVERSE_ITERATORS(_Super)
       
    55     __IMPORT_SUPER_COPY_ASSIGNMENT(list, list<_Tp>, __LIST_SUPER)
       
    56     list() { }
       
    57     explicit list(size_type __n, const _Tp& __value) : __LIST_SUPER(__n, __value) { }
       
    58     explicit list(size_type __n) :  __LIST_SUPER(__n) { } 
       
    59     list(const _Tp* __first, const _Tp* __last) : __LIST_SUPER(__first, __last) { } 
       
    60     list(const_iterator __first, const_iterator __last) : __LIST_SUPER(__first, __last) { }
       
    61 # undef __LIST_SUPER
       
    62 };
       
    63 
       
    64 #  if defined (_STLP_BASE_MATCH_BUG)
       
    65 template <class _Tp>
       
    66 inline bool operator==(const list<_Tp>& __x, const list<_Tp>& __y) {
       
    67     typedef typename list<_Tp>::_Super _Super;
       
    68     return operator == ((const _Super&)__x,(const _Super&)__y);
       
    69 }
       
    70 
       
    71 template <class _Tp>
       
    72 inline bool operator<(const list<_Tp>& __x, const list<_Tp>& __y) {
       
    73   return lexicographical_compare(__x.begin(), __x.end(),
       
    74                                  __y.begin(), __y.end());
       
    75 }
       
    76 #  endif
       
    77 
       
    78 # ifdef _STLP_USE_NAMESPACES
       
    79 } /* namespace STLPORT */
       
    80 # endif
       
    81 
       
    82 #endif /* _STLP_INTERNAL_LIST_H */
       
    83 
       
    84 // Local Variables:
       
    85 // mode:C++
       
    86 // End: