1.1 --- a/epoc32/include/stdapis/stlport/stl/_stack.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/stlport/stl/_stack.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,105 @@
1.4 -_stack.h
1.5 +/*
1.6 + *
1.7 + * Copyright (c) 1994
1.8 + * Hewlett-Packard Company
1.9 + *
1.10 + * Copyright (c) 1996,1997
1.11 + * Silicon Graphics Computer Systems, Inc.
1.12 + *
1.13 + * Copyright (c) 1997
1.14 + * Moscow Center for SPARC Technology
1.15 + *
1.16 + * Copyright (c) 1999
1.17 + * Boris Fomitchev
1.18 + *
1.19 + * This material is provided "as is", with absolutely no warranty expressed
1.20 + * or implied. Any use is at your own risk.
1.21 + *
1.22 + * Permission to use or copy this software for any purpose is hereby granted
1.23 + * without fee, provided the above notices are retained on all copies.
1.24 + * Permission to modify the code and to distribute modified code is granted,
1.25 + * provided the above notices are retained, and a notice that the code was
1.26 + * modified is included with the above copyright notice.
1.27 + *
1.28 + */
1.29 +
1.30 +/* NOTE: This is an internal header file, included by other STL headers.
1.31 + * You should not attempt to use it directly.
1.32 + */
1.33 +
1.34 +#ifndef _STLP_INTERNAL_STACK_H
1.35 +#define _STLP_INTERNAL_STACK_H
1.36 +
1.37 +#ifndef _STLP_INTERNAL_DEQUE_H
1.38 +# include <stl/_deque.h>
1.39 +#endif
1.40 +
1.41 +_STLP_BEGIN_NAMESPACE
1.42 +
1.43 +# if !defined ( _STLP_LIMITED_DEFAULT_TEMPLATES )
1.44 +template <class _Tp, class _Sequence = deque<_Tp> >
1.45 +# elif defined ( _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS )
1.46 +# define _STLP_STACK_ARGS _Tp
1.47 +template <class _Tp>
1.48 +# else
1.49 +template <class _Tp, class _Sequence>
1.50 +# endif
1.51 +class stack {
1.52 +
1.53 +# ifdef _STLP_STACK_ARGS
1.54 + typedef deque<_Tp> _Sequence;
1.55 +# endif
1.56 +
1.57 +public:
1.58 + typedef typename _Sequence::value_type value_type;
1.59 + typedef typename _Sequence::size_type size_type;
1.60 + typedef _Sequence container_type;
1.61 +
1.62 + typedef typename _Sequence::reference reference;
1.63 + typedef typename _Sequence::const_reference const_reference;
1.64 +protected:
1.65 + _Sequence c;
1.66 +public:
1.67 + stack() : c() {}
1.68 + explicit stack(const _Sequence& __s) : c(__s) {}
1.69 +
1.70 + bool empty() const { return c.empty(); }
1.71 + size_type size() const { return c.size(); }
1.72 + reference top() { return c.back(); }
1.73 + const_reference top() const { return c.back(); }
1.74 + void push(const value_type& __x) { c.push_back(__x); }
1.75 + void pop() { c.pop_back(); }
1.76 + const _Sequence& _Get_c() const { return c; }
1.77 +};
1.78 +
1.79 +# ifndef _STLP_STACK_ARGS
1.80 +# define _STLP_STACK_ARGS _Tp, _Sequence
1.81 +# define _STLP_STACK_HEADER_ARGS class _Tp, class _Sequence
1.82 +# else
1.83 +# define _STLP_STACK_HEADER_ARGS class _Tp
1.84 +# endif
1.85 +
1.86 +template < _STLP_STACK_HEADER_ARGS >
1.87 +inline bool _STLP_CALL operator==(const stack< _STLP_STACK_ARGS >& __x, const stack< _STLP_STACK_ARGS >& __y)
1.88 +{
1.89 + return __x._Get_c() == __y._Get_c();
1.90 +}
1.91 +
1.92 +template < _STLP_STACK_HEADER_ARGS >
1.93 +inline bool _STLP_CALL operator<(const stack< _STLP_STACK_ARGS >& __x, const stack< _STLP_STACK_ARGS >& __y)
1.94 +{
1.95 + return __x._Get_c() < __y._Get_c();
1.96 +}
1.97 +
1.98 +_STLP_RELOPS_OPERATORS(template < _STLP_STACK_HEADER_ARGS >, stack< _STLP_STACK_ARGS >)
1.99 +
1.100 +_STLP_END_NAMESPACE
1.101 +
1.102 +# undef _STLP_STACK_ARGS
1.103 +# undef _STLP_STACK_HEADER_ARGS
1.104 +
1.105 +#endif /* _STLP_INTERNAL_STACK_H */
1.106 +
1.107 +// Local Variables:
1.108 +// mode:C++
1.109 +// End: