epoc32/include/tools/stlport/stl/_stack.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/tools/stlport/stl/_stack.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,124 @@
     1.4 +/*
     1.5 + *
     1.6 + * Copyright (c) 1994
     1.7 + * Hewlett-Packard Company
     1.8 + *
     1.9 + * Copyright (c) 1996,1997
    1.10 + * Silicon Graphics Computer Systems, Inc.
    1.11 + *
    1.12 + * Copyright (c) 1997
    1.13 + * Moscow Center for SPARC Technology
    1.14 + *
    1.15 + * Copyright (c) 1999
    1.16 + * Boris Fomitchev
    1.17 + *
    1.18 + * This material is provided "as is", with absolutely no warranty expressed
    1.19 + * or implied. Any use is at your own risk.
    1.20 + *
    1.21 + * Permission to use or copy this software for any purpose is hereby granted
    1.22 + * without fee, provided the above notices are retained on all copies.
    1.23 + * Permission to modify the code and to distribute modified code is granted,
    1.24 + * provided the above notices are retained, and a notice that the code was
    1.25 + * modified is included with the above copyright notice.
    1.26 + *
    1.27 + */
    1.28 +
    1.29 +/* NOTE: This is an internal header file, included by other STL headers.
    1.30 + *   You should not attempt to use it directly.
    1.31 + */
    1.32 +
    1.33 +#ifndef _STLP_INTERNAL_STACK_H
    1.34 +#define _STLP_INTERNAL_STACK_H
    1.35 +
    1.36 +#ifndef _STLP_INTERNAL_DEQUE_H
    1.37 +#  include <stl/_deque.h>
    1.38 +#endif
    1.39 +
    1.40 +_STLP_BEGIN_NAMESPACE
    1.41 +
    1.42 +#if !defined ( _STLP_LIMITED_DEFAULT_TEMPLATES )
    1.43 +template <class _Tp, class _Sequence = deque<_Tp> >
    1.44 +#elif defined ( _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS )
    1.45 +#  define _STLP_STACK_ARGS _Tp
    1.46 +template <class _Tp>
    1.47 +#else
    1.48 +template <class _Tp, class _Sequence>
    1.49 +#endif
    1.50 +class stack
    1.51 +#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
    1.52 +#  if defined (_STLP_STACK_ARGS)
    1.53 +            : public __stlport_class<stack<_Tp> >
    1.54 +#  else
    1.55 +            : public __stlport_class<stack<_Tp, _Sequence> >
    1.56 +#  endif
    1.57 +#endif
    1.58 +{
    1.59 +#ifdef _STLP_STACK_ARGS
    1.60 +  typedef deque<_Tp> _Sequence;
    1.61 +  typedef stack<_Tp> _Self;
    1.62 +#else
    1.63 +  typedef stack<_Tp, _Sequence> _Self;
    1.64 +#endif
    1.65 +
    1.66 +public:
    1.67 +  typedef typename _Sequence::value_type      value_type;
    1.68 +  typedef typename _Sequence::size_type       size_type;
    1.69 +  typedef          _Sequence                  container_type;
    1.70 +
    1.71 +  typedef typename _Sequence::reference       reference;
    1.72 +  typedef typename _Sequence::const_reference const_reference;
    1.73 +protected:
    1.74 +  //c is a Standard name (23.2.3.3), do no make it STLport naming convention compliant.
    1.75 +  _Sequence c;
    1.76 +public:
    1.77 +  stack() : c() {}
    1.78 +  explicit stack(const _Sequence& __s) : c(__s) {}
    1.79 +
    1.80 +  stack(__move_source<_Self> src)
    1.81 +    : c(_STLP_PRIV _AsMoveSource(src.get().c)) {}
    1.82 +
    1.83 +  bool empty() const { return c.empty(); }
    1.84 +  size_type size() const { return c.size(); }
    1.85 +  reference top() { return c.back(); }
    1.86 +  const_reference top() const { return c.back(); }
    1.87 +  void push(const value_type& __x) { c.push_back(__x); }
    1.88 +  void pop() { c.pop_back(); }
    1.89 +  const _Sequence& _Get_s() const { return c; }
    1.90 +};
    1.91 +
    1.92 +#ifndef _STLP_STACK_ARGS
    1.93 +#  define _STLP_STACK_ARGS _Tp, _Sequence
    1.94 +#  define _STLP_STACK_HEADER_ARGS class _Tp, class _Sequence
    1.95 +#else
    1.96 +#  define _STLP_STACK_HEADER_ARGS class _Tp
    1.97 +#endif
    1.98 +
    1.99 +template < _STLP_STACK_HEADER_ARGS >
   1.100 +inline bool _STLP_CALL  operator==(const stack< _STLP_STACK_ARGS >& __x,
   1.101 +                                   const stack< _STLP_STACK_ARGS >& __y)
   1.102 +{ return __x._Get_s() == __y._Get_s(); }
   1.103 +
   1.104 +template < _STLP_STACK_HEADER_ARGS >
   1.105 +inline bool _STLP_CALL  operator<(const stack< _STLP_STACK_ARGS >& __x,
   1.106 +                                  const stack< _STLP_STACK_ARGS >& __y)
   1.107 +{ return __x._Get_s() < __y._Get_s(); }
   1.108 +
   1.109 +_STLP_RELOPS_OPERATORS(template < _STLP_STACK_HEADER_ARGS >, stack< _STLP_STACK_ARGS >)
   1.110 +
   1.111 +#undef _STLP_STACK_ARGS
   1.112 +#undef _STLP_STACK_HEADER_ARGS
   1.113 +
   1.114 +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
   1.115 +template <class _Tp, class _Sequence>
   1.116 +struct __move_traits<stack<_Tp, _Sequence> > :
   1.117 +  _STLP_PRIV __move_traits_aux<_Sequence>
   1.118 +{};
   1.119 +#endif
   1.120 +
   1.121 +_STLP_END_NAMESPACE
   1.122 +
   1.123 +#endif /* _STLP_INTERNAL_STACK_H */
   1.124 +
   1.125 +// Local Variables:
   1.126 +// mode:C++
   1.127 +// End: