diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/stdapis/stlportv5/stl/_stack.h --- a/epoc32/include/stdapis/stlportv5/stl/_stack.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/stdapis/stlportv5/stl/_stack.h Wed Mar 31 12:33:34 2010 +0100 @@ -9,13 +9,13 @@ * Copyright (c) 1997 * Moscow Center for SPARC Technology * - * Copyright (c) 1999 + * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * - * Permission to use or copy this software for any purpose is hereby granted + * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was @@ -31,24 +31,34 @@ #define _STLP_INTERNAL_STACK_H #ifndef _STLP_INTERNAL_DEQUE_H -# include +# include #endif _STLP_BEGIN_NAMESPACE -# if !defined ( _STLP_LIMITED_DEFAULT_TEMPLATES ) +#if !defined ( _STLP_LIMITED_DEFAULT_TEMPLATES ) template > -# elif defined ( _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS ) -# define _STLP_STACK_ARGS _Tp +#elif defined ( _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS ) +# define _STLP_STACK_ARGS _Tp template -# else +#else template -# endif -class stack { - -# ifdef _STLP_STACK_ARGS +#endif +class stack +#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) +# if defined (_STLP_STACK_ARGS) + : public __stlport_class > +# else + : public __stlport_class > +# endif +#endif +{ +#ifdef _STLP_STACK_ARGS typedef deque<_Tp> _Sequence; -# endif + typedef stack<_Tp> _Self; +#else + typedef stack<_Tp, _Sequence> _Self; +#endif public: typedef typename _Sequence::value_type value_type; @@ -58,46 +68,55 @@ typedef typename _Sequence::reference reference; typedef typename _Sequence::const_reference const_reference; protected: + //c is a Standard name (23.2.3.3), do no make it STLport naming convention compliant. _Sequence c; public: stack() : c() {} explicit stack(const _Sequence& __s) : c(__s) {} + stack(__move_source<_Self> src) + : c(_STLP_PRIV _AsMoveSource(src.get().c)) {} + bool empty() const { return c.empty(); } size_type size() const { return c.size(); } reference top() { return c.back(); } const_reference top() const { return c.back(); } void push(const value_type& __x) { c.push_back(__x); } void pop() { c.pop_back(); } - const _Sequence& _Get_c() const { return c; } + const _Sequence& _Get_s() const { return c; } }; -# ifndef _STLP_STACK_ARGS +#ifndef _STLP_STACK_ARGS # define _STLP_STACK_ARGS _Tp, _Sequence # define _STLP_STACK_HEADER_ARGS class _Tp, class _Sequence -# else +#else # define _STLP_STACK_HEADER_ARGS class _Tp -# endif +#endif template < _STLP_STACK_HEADER_ARGS > -inline bool _STLP_CALL operator==(const stack< _STLP_STACK_ARGS >& __x, const stack< _STLP_STACK_ARGS >& __y) -{ - return __x._Get_c() == __y._Get_c(); -} +inline bool _STLP_CALL operator==(const stack< _STLP_STACK_ARGS >& __x, + const stack< _STLP_STACK_ARGS >& __y) +{ return __x._Get_s() == __y._Get_s(); } template < _STLP_STACK_HEADER_ARGS > -inline bool _STLP_CALL operator<(const stack< _STLP_STACK_ARGS >& __x, const stack< _STLP_STACK_ARGS >& __y) -{ - return __x._Get_c() < __y._Get_c(); -} +inline bool _STLP_CALL operator<(const stack< _STLP_STACK_ARGS >& __x, + const stack< _STLP_STACK_ARGS >& __y) +{ return __x._Get_s() < __y._Get_s(); } _STLP_RELOPS_OPERATORS(template < _STLP_STACK_HEADER_ARGS >, stack< _STLP_STACK_ARGS >) - + +#undef _STLP_STACK_ARGS +#undef _STLP_STACK_HEADER_ARGS + +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) +template +struct __move_traits > : + _STLP_PRIV __move_traits_aux<_Sequence> +{}; +#endif + _STLP_END_NAMESPACE -# undef _STLP_STACK_ARGS -# undef _STLP_STACK_HEADER_ARGS - #endif /* _STLP_INTERNAL_STACK_H */ // Local Variables: