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